Skip to content

Commit

Permalink
Input: ts4800-ts - add missing of_node_put after calling of_parse_pha…
Browse files Browse the repository at this point in the history
…ndle

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>
  • Loading branch information
Peter Chen authored and Dmitry Torokhov committed Jul 15, 2016
1 parent 9624516 commit 6a5029e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/input/touchscreen/ts4800-ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;
}

Expand Down

0 comments on commit 6a5029e

Please sign in to comment.