diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:17:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:15 -0400 |
commit | ef73e632fe48b97e67cbff339f9e7d30535d682f (patch) | |
tree | 1fb4445ee953536863d04d985360cc7f587265cb /drivers/video/backlight | |
parent | 8541b827451e0dd907f4a0088213b8982347ce3a (diff) |
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 <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/l4f00242t03.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index fb6155771326..a35a38c709cf 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c | |||
@@ -51,14 +51,33 @@ static void l4f00242t03_lcd_init(struct spi_device *spi) | |||
51 | struct l4f00242t03_pdata *pdata = spi->dev.platform_data; | 51 | struct l4f00242t03_pdata *pdata = spi->dev.platform_data; |
52 | struct l4f00242t03_priv *priv = spi_get_drvdata(spi); | 52 | struct l4f00242t03_priv *priv = spi_get_drvdata(spi); |
53 | const u16 cmd[] = { 0x36, param(0), 0x3A, param(0x60) }; | 53 | const u16 cmd[] = { 0x36, param(0), 0x3A, param(0x60) }; |
54 | int ret; | ||
54 | 55 | ||
55 | dev_dbg(&spi->dev, "initializing LCD\n"); | 56 | dev_dbg(&spi->dev, "initializing LCD\n"); |
56 | 57 | ||
57 | regulator_set_voltage(priv->io_reg, 1800000, 1800000); | 58 | ret = regulator_set_voltage(priv->io_reg, 1800000, 1800000); |
58 | regulator_enable(priv->io_reg); | 59 | if (ret) { |
60 | dev_err(&spi->dev, "failed to set the IO regulator voltage.\n"); | ||
61 | return; | ||
62 | } | ||
63 | ret = regulator_enable(priv->io_reg); | ||
64 | if (ret) { | ||
65 | dev_err(&spi->dev, "failed to enable the IO regulator.\n"); | ||
66 | return; | ||
67 | } | ||
59 | 68 | ||
60 | regulator_set_voltage(priv->core_reg, 2800000, 2800000); | 69 | ret = regulator_set_voltage(priv->core_reg, 2800000, 2800000); |
61 | regulator_enable(priv->core_reg); | 70 | if (ret) { |
71 | dev_err(&spi->dev, "failed to set the core regulator voltage.\n"); | ||
72 | regulator_disable(priv->io_reg); | ||
73 | return; | ||
74 | } | ||
75 | ret = regulator_enable(priv->core_reg); | ||
76 | if (ret) { | ||
77 | dev_err(&spi->dev, "failed to enable the core regulator.\n"); | ||
78 | regulator_disable(priv->io_reg); | ||
79 | return; | ||
80 | } | ||
62 | 81 | ||
63 | l4f00242t03_reset(pdata->reset_gpio); | 82 | l4f00242t03_reset(pdata->reset_gpio); |
64 | 83 | ||