diff options
author | Dong Aisheng <aisheng.dong@nxp.com> | 2017-04-11 21:58:44 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-04-11 16:35:58 -0400 |
commit | 5062e04711dbc4f67b24ffd926cc67060267792d (patch) | |
tree | 1c1acf762f841a82150ea21c9cd473aab3e5b36e | |
parent | 7f51cf2ea7186e3f217e616a5522f1156678356f (diff) |
regulator: anatop: use of_property_read_string to read the name
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@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/regulator/anatop-regulator.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
193 | sreg = devm_kzalloc(dev, sizeof(*sreg), GFP_KERNEL); | 193 | sreg = devm_kzalloc(dev, sizeof(*sreg), GFP_KERNEL); |
194 | if (!sreg) | 194 | if (!sreg) |
195 | return -ENOMEM; | 195 | return -ENOMEM; |
196 | sreg->name = of_get_property(np, "regulator-name", NULL); | 196 | |
197 | of_property_read_string(np, "regulator-name", &sreg->name); | ||
197 | rdesc = &sreg->rdesc; | 198 | rdesc = &sreg->rdesc; |
198 | rdesc->name = sreg->name; | 199 | rdesc->name = sreg->name; |
199 | rdesc->type = REGULATOR_VOLTAGE; | 200 | rdesc->type = REGULATOR_VOLTAGE; |