From: Jingoo Han Date: Tue, 26 Mar 2013 23:24:57 +0000 (+1100) Subject: drivers/video/backlight/l4f00242t03.c: check return value of regulator_enable() X-Git-Tag: next-20130404~3^2~326 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bcda658b4003e025497aa340ef62f92f4253166a;p=karo-tx-linux.git drivers/video/backlight/l4f00242t03.c: check return value of regulator_enable() regulator_enable() is marked as as __must_check. Therefore the return value of regulator_enable() should be checked. Also, this patch checks return value of regulator_set_voltage(). Signed-off-by: Jingoo Han Signed-off-by: Andrew Morton --- diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index fb6155771326..8d54c3c10807 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c @@ -51,14 +51,31 @@ static void l4f00242t03_lcd_init(struct spi_device *spi) struct l4f00242t03_pdata *pdata = spi->dev.platform_data; struct l4f00242t03_priv *priv = spi_get_drvdata(spi); const u16 cmd[] = { 0x36, param(0), 0x3A, param(0x60) }; + int ret; dev_dbg(&spi->dev, "initializing LCD\n"); - regulator_set_voltage(priv->io_reg, 1800000, 1800000); - regulator_enable(priv->io_reg); + ret = regulator_set_voltage(priv->io_reg, 1800000, 1800000); + if (ret) { + dev_err(&spi->dev, "failed to set the IO regulator voltage.\n"); + return; + } + ret = regulator_enable(priv->io_reg); + if (ret) { + dev_err(&spi->dev, "failed to enable the IO regulator.\n"); + return; + } - regulator_set_voltage(priv->core_reg, 2800000, 2800000); - regulator_enable(priv->core_reg); + ret = regulator_set_voltage(priv->core_reg, 2800000, 2800000); + if (ret) { + dev_err(&spi->dev, "failed to set the core regulator voltage.\n"); + return; + } + ret = regulator_enable(priv->core_reg); + if (ret) { + dev_err(&spi->dev, "failed to enable the core regulator.\n"); + return; + } l4f00242t03_reset(pdata->reset_gpio);