regulator: anatop: use of_property_read_string to read the name
authorDong Aisheng <aisheng.dong@nxp.com>
Wed, 12 Apr 2017 01:58:44 +0000 (09:58 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 11 Apr 2017 20:35:58 +0000 (21:35 +0100)
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>
drivers/regulator/anatop-regulator.c

index aa93f46..58141cb 100644 (file)
@@ -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;