Skip to content

Commit

Permalink
drm/imx: imx-tve: check the value returned by regulator_set_voltage()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fabio Estevam authored and Philipp Zabel committed Jul 12, 2016
1 parent 7075ba7 commit deb6587
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/imx/imx-tve.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit deb6587

Please sign in to comment.