[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210928133143.157329-9-miquel.raynal@bootlin.com>
Date: Tue, 28 Sep 2021 15:31:03 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Lee Jones <lee.jones@...aro.org>
Cc: Peter Meerwald-Stadler <pmeerw@...erw.net>,
Rob Herring <robh+dt@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
bcousson@...libre.com, Tony Lindgren <tony@...mide.com>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-omap@...r.kernel.org,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Vignesh Raghavendra <vigneshr@...com>,
Lokesh Vutla <lokeshvutla@...com>,
Tero Kristo <kristo@...nel.org>,
Ryan Barnett <ryan.barnett@...lins.com>,
Grygorii Strashko <grygorii.strashko@...com>,
Jason Reeder <jreeder@...com>, <linux-kernel@...r.kernel.org>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: [PATCH v4 08/48] mfd: ti_am335x_tscadc: Ensure a balanced number of node get/put
of_node_put() should be called after a successful of_get_child_by_name().
Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
---
drivers/mfd/ti_am335x_tscadc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index 55adc379f94b..eb5c23e3eacd 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -142,6 +142,7 @@ static int ti_tscadc_probe(struct platform_device *pdev)
node = of_get_child_by_name(pdev->dev.of_node, "tsc");
of_property_read_u32(node, "ti,wires", &tsc_wires);
of_property_read_u32(node, "ti,coordiante-readouts", &readouts);
+ of_node_put(node);
node = of_get_child_by_name(pdev->dev.of_node, "adc");
of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) {
@@ -149,9 +150,13 @@ static int ti_tscadc_probe(struct platform_device *pdev)
if (val > 7) {
dev_err(&pdev->dev, " PIN numbers are 0..7 (not %d)\n",
val);
+ of_node_put(node);
return -EINVAL;
}
}
+
+ of_node_put(node);
+
total_channels = tsc_wires + adc_channels;
if (total_channels > 8) {
dev_err(&pdev->dev, "Number of i/p channels more than 8\n");
--
2.27.0
Powered by blists - more mailing lists