summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorHaibo Chen <haibo.chen@nxp.com>2019-08-06 21:09:31 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2021-11-02 16:56:31 +0800
commit2281594e763b16e7cdac8e2a4c4deb1109eccbfe (patch)
tree4d0bf4018028ceec8afd7731e9eb16e0efcd3c1a /drivers/input/touchscreen
parent54fcaa7e7c4edc52b07400f297d45ca1035ab134 (diff)
Input: ads7846: add return value check after calling .of_property_read_u32()
Add return value check after calling .of_property_read_u32(). The issue was reported by coverity. Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/ads7846.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index f113a27aeb1e..52b8f9b32b3a 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1141,6 +1141,7 @@ static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev)
struct device_node *node = dev->of_node;
const struct of_device_id *match;
u32 value;
+ int ret;
if (!node) {
dev_err(dev, "Device does not have associated DT data\n");
@@ -1194,8 +1195,11 @@ static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev)
of_property_read_u16(node, "ti,debounce-tol", &pdata->debounce_tol);
of_property_read_u16(node, "ti,debounce-rep", &pdata->debounce_rep);
- of_property_read_u32(node, "ti,pendown-gpio-debounce",
+ ret = of_property_read_u32(node, "ti,pendown-gpio-debounce",
&pdata->gpio_pendown_debounce);
+ if (!ret)
+ dev_info(dev, "Set pendown gpio debounce time to %d microseconds\n",
+ pdata->gpio_pendown_debounce);
pdata->wakeup = of_property_read_bool(node, "wakeup-source") ||
of_property_read_bool(node, "linux,wakeup");