summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2016-07-15 19:32:54 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-07-15 20:50:12 +0300
commit6a5029e66404462a3322dba8e35615bd09332081 (patch)
treee655c48ae3554f4af3a7e395348dc00b8dc789ed /drivers/input
parent9624516db0f3ffcbd1ba1007775d068f54049773 (diff)
downloadlinux-6a5029e66404462a3322dba8e35615bd09332081.tar.xz
Input: ts4800-ts - add missing of_node_put after calling of_parse_phandle
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/ts4800-ts.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/ts4800-ts.c b/drivers/input/touchscreen/ts4800-ts.c
index 3c3dd78303be..fed73eeb47b3 100644
--- a/drivers/input/touchscreen/ts4800-ts.c
+++ b/drivers/input/touchscreen/ts4800-ts.c
@@ -118,6 +118,13 @@ static int ts4800_parse_dt(struct platform_device *pdev,
return -ENODEV;
}
+ ts->regmap = syscon_node_to_regmap(syscon_np);
+ of_node_put(syscon_np);
+ if (IS_ERR(ts->regmap)) {
+ dev_err(dev, "cannot get parent's regmap\n");
+ return PTR_ERR(ts->regmap);
+ }
+
error = of_property_read_u32_index(np, "syscon", 1, &reg);
if (error < 0) {
dev_err(dev, "no offset in syscon\n");
@@ -134,12 +141,6 @@ static int ts4800_parse_dt(struct platform_device *pdev,
ts->bit = BIT(bit);
- ts->regmap = syscon_node_to_regmap(syscon_np);
- if (IS_ERR(ts->regmap)) {
- dev_err(dev, "cannot get parent's regmap\n");
- return PTR_ERR(ts->regmap);
- }
-
return 0;
}