]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/imx: imx-tve: check the value returned by regulator_set_voltage()
authorFabio Estevam <fabio.estevam@nxp.com>
Sat, 9 Jul 2016 21:57:42 +0000 (18:57 -0300)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 12 Jul 2016 16:24:30 +0000 (18:24 +0200)
regulator_set_voltage() may fail, so we better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/drm/imx/imx-tve.c

index a293a7dad0d975335624a8327b01608dd5915fe1..fe36309e18c111114361e96f37255c3a2f5b1e61 100644 (file)
@@ -628,7 +628,9 @@ static int imx_tve_bind(struct device *dev, struct device *master, void *data)
 
        tve->dac_reg = devm_regulator_get(dev, "dac");
        if (!IS_ERR(tve->dac_reg)) {
-               regulator_set_voltage(tve->dac_reg, 2750000, 2750000);
+               ret = regulator_set_voltage(tve->dac_reg, 2750000, 2750000);
+               if (ret)
+                       return ret;
                ret = regulator_enable(tve->dac_reg);
                if (ret)
                        return ret;