Skip to content

Commit

Permalink
regulator: anatop: use of_property_read_string to read the name
Browse files Browse the repository at this point in the history
sreg->name is a string, so use a more proper api to read back the string
instead of of_get_property.

Signed-off-by: Dong Aisheng <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Dong Aisheng authored and broonie committed Apr 11, 2017
1 parent 7f51cf2 commit 5062e04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/regulator/anatop-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ static int anatop_regulator_probe(struct platform_device *pdev)
sreg = devm_kzalloc(dev, sizeof(*sreg), GFP_KERNEL);
if (!sreg)
return -ENOMEM;
sreg->name = of_get_property(np, "regulator-name", NULL);

of_property_read_string(np, "regulator-name", &sreg->name);
rdesc = &sreg->rdesc;
rdesc->name = sreg->name;
rdesc->type = REGULATOR_VOLTAGE;
Expand Down

0 comments on commit 5062e04

Please sign in to comment.