Skip to contentSkip to conversation

regulator: palmas: Use of_property_read_bool to read "ti,warm-reset" DT property

PATCH Applied Axel Lin 3 participants 3 messages Mar 12, 2013

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: palmas: Use of_property_read_bool to read "ti,warm-reset" DT property

It does not make sense to assign return value of of_property_read_u32() to pdata->reg_init[idx]->warm_reset. Use of_property_read_bool() to read "ti,warm-reset" DT property instead which will return correct setting for pdata->reg_init[idx]->warm_reset.

---
 drivers/regulator/palmas-regulator.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/palmas-regulator.c +2 -2
index b2b1baa..a9b558e 100644
@@ -554,8 +554,8 @@ static void palmas_dt_to_pdata(struct device *dev,
 				sizeof(struct palmas_reg_init), GFP_KERNEL);
 
 		pdata->reg_init[idx]->warm_reset =
-			of_property_read_u32(palmas_matches[idx].of_node,
-					     "ti,warm-reset", &prop);
+			of_property_read_bool(palmas_matches[idx].of_node,
+					     "ti,warm-reset");
 
 		pdata->reg_init[idx]->roof_floor =
 			of_property_read_bool(palmas_matches[idx].of_node,
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw

Thanks for catching that typo

Quoted 25 lines · Axel Lin

It does not make sense to assign return value of of_property_read_u32() to pdata->reg_init[idx]->warm_reset. Use of_property_read_bool() to read "ti,warm-reset" DT property instead which will return correct setting for pdata->reg_init[idx]->warm_reset.

---
 drivers/regulator/palmas-regulator.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/palmas-regulator.c +2 -2
index b2b1baa..a9b558e 100644
@@ -554,8 +554,8 @@ static void palmas_dt_to_pdata(struct device *dev,
 				sizeof(struct palmas_reg_init), GFP_KERNEL);
 
 		pdata->reg_init[idx]->warm_reset =
-			of_property_read_u32(palmas_matches[idx].of_node,
-					     "ti,warm-reset", &prop);
+			of_property_read_bool(palmas_matches[idx].of_node,
+					     "ti,warm-reset");
 
 		pdata->reg_init[idx]->roof_floor =
 			of_property_read_bool(palmas_matches[idx].of_node,
Applied
#2 lore raw
In reply to Axel Lin
Quoted 4 lines · Axel Lin

It does not make sense to assign return value of of_property_read_u32() to pdata->reg_init[idx]->warm_reset. Use of_property_read_bool() to read "ti,warm-reset" DT property instead which will return correct setting for pdata->reg_init[idx]->warm_reset.

Applied, thanks.