Skip to contentSkip to conversation

extcon: arizona: Switch to use device_property_count_u32()

PATCH Applied Andy Shevchenko 3 participants 3 messages Jul 23, 2019 – Jul 24, 2019 External connector subsystem (extcon)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 extcon: arizona: Switch to use device_property_count_u32()

Use use device_property_count_u32() directly, that makes code neater.

---
 drivers/extcon/extcon-arizona.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-arizona.c +1 -1
index 7e9f4c9ee87d..e970134c95fa 100644
@@ -1253,7 +1253,7 @@ static int arizona_extcon_get_micd_configs(struct device *dev,
 	int i, j;
 	u32 *vals;
 
-	nconfs = device_property_read_u32_array(arizona->dev, prop, NULL, 0);
+	nconfs = device_property_count_u32(arizona->dev, prop);
 	if (nconfs <= 0)
 		return 0;
 
Signature · 1 line
2.20.1
maintainer Applied
#2 lore raw
In reply to Andy Shevchenko
Quoted 13 lines · Andy Shevchenko

Use use device_property_count_u32() directly, that makes code neater.

---
 drivers/extcon/extcon-arizona.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-arizona.c +0 -0
index 7e9f4c9ee87d..e970134c95fa 100644

drivers/extcon/extcon-arizona.c static int arizona_extcon_get_micd_configs(struct device *dev, · line 1259

Quoted 8 lines
drivers/extcon/extcon-arizona.c +1 -1
@@ -1253,7 +1253,7 @@ static int arizona_extcon_get_micd_configs(struct device *dev,
 	int i, j;
 	u32 *vals;
 
-	nconfs = device_property_read_u32_array(arizona->dev, prop, NULL, 0);
+	nconfs = device_property_count_u32(arizona->dev, prop);
 	if (nconfs <= 0)
 		return 0;
 

Applied it. Thanks.

Signature · 3 lines
Best Regards,
Chanwoo Choi
Samsung Electronics