summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>2024-10-19 21:18:57 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2024-10-19 21:21:43 -0700
commit00850d7b542aa4a8240cf977d43dc6d2158e48d7 (patch)
tree03e6e3a2d16cc0f1bdb706a814c6bac9d2507d76 /drivers/input
parentcd63c67be6094825ff06b2649c6d9b33cb38a1b9 (diff)
Input: ts4800-ts - use cleanup facility for device_node
Use the '__free(device_node)' macro to automatically free the device node, removing the need for explicit calls to 'of_node_put()' to decrement its refcount. Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-10-ebc62138fbf8@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/ts4800-ts.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/ts4800-ts.c b/drivers/input/touchscreen/ts4800-ts.c
index 6cf66aadc10e..98422d1e80d6 100644
--- a/drivers/input/touchscreen/ts4800-ts.c
+++ b/drivers/input/touchscreen/ts4800-ts.c
@@ -110,18 +110,17 @@ static int ts4800_parse_dt(struct platform_device *pdev,
{
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
- struct device_node *syscon_np;
u32 reg, bit;
int error;
- syscon_np = of_parse_phandle(np, "syscon", 0);
+ struct device_node *syscon_np __free(device_node) =
+ of_parse_phandle(np, "syscon", 0);
if (!syscon_np) {
dev_err(dev, "no syscon property\n");
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);