diff mbox series

[12/20] iio: adc: ti_am335x_adc: convert to of_property_for_each_u32_new()

Message ID 20240703-of_property_for_each_u32-v1-12-42c1fc0b82aa@bootlin.com (mailing list archive)
State New
Headers show
Series Simplify of_property_for_each_u32() | expand

Commit Message

Luca Ceresoli July 3, 2024, 10:36 a.m. UTC
Simplify code using of_property_for_each_u32_new() as the two additional
parameters in of_property_for_each_u32() are not used here.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
 drivers/iio/adc/ti_am335x_adc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jonathan Cameron July 3, 2024, 3:34 p.m. UTC | #1
On Wed, 03 Jul 2024 12:36:56 +0200
Luca Ceresoli <luca.ceresoli@bootlin.com> wrote:

> Simplify code using of_property_for_each_u32_new() as the two additional
> parameters in of_property_for_each_u32() are not used here.
> 
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
diff mbox series

Patch

diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index 95fa857e8aad..ca0f542ebc77 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -564,13 +564,11 @@  static int tiadc_parse_dt(struct platform_device *pdev,
 			  struct tiadc_device *adc_dev)
 {
 	struct device_node *node = pdev->dev.of_node;
-	struct property *prop;
-	const __be32 *cur;
 	int channels = 0;
 	u32 val;
 	int i;
 
-	of_property_for_each_u32(node, "ti,adc-channels", prop, cur, val) {
+	of_property_for_each_u32_new(node, "ti,adc-channels", val) {
 		adc_dev->channel_line[channels] = val;
 
 		/* Set Default values for optional DT parameters */