[PATCH] regulator: anatop: use of_property_read_string to read the name

From: Dong Aisheng
Date: Tue Apr 11 2017 - 21:58:44 EST


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 <aisheng.dong@xxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
---
drivers/regulator/anatop-regulator.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index aa93f462ac6e..58141cbdf257 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -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;
--
2.11.0