thermal: exynos: Use devm_regulator_get_optional() for vtmu
authorJavier Martinez Canillas <javier@osg.samsung.com>
Thu, 18 Feb 2016 18:19:10 +0000 (15:19 -0300)
committerEduardo Valentin <edubezval@gmail.com>
Tue, 8 Mar 2016 22:21:41 +0000 (14:21 -0800)
The Exynos TMU DT binding says that the vtmu-supply is optional but the
driver uses devm_regulator_get() that creates a dummy regulator if it's
not defined in the DT. For example the following message is in the log:

10060000.tmu supply vtmu not found, using dummy regulator

Use the optional version of regulator_get() that doesn't create a dummy
regulator and instead returns a -ENODEV errno code. Since it's expected
that a regulator may not be defined and the driver will inform about it:

exynos-tmu 10060000.tmu: Regulator node (vtmu) not found

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/samsung/exynos_tmu.c

index 6c6f59ba742328922c3184318dc62ae3faa6c851..f4f36bba7be9b45c6ed2c716169af2fae6d224fe 100644 (file)
@@ -1310,7 +1310,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
         * TODO: Add regulator as an SOC feature, so that regulator enable
         * is a compulsory call.
         */
-       data->regulator = devm_regulator_get(&pdev->dev, "vtmu");
+       data->regulator = devm_regulator_get_optional(&pdev->dev, "vtmu");
        if (!IS_ERR(data->regulator)) {
                ret = regulator_enable(data->regulator);
                if (ret) {