aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/backlight/l4f00242t03.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
index 9bef9cf96b20..fb6155771326 100644
--- a/drivers/video/backlight/l4f00242t03.c
+++ b/drivers/video/backlight/l4f00242t03.c
@@ -190,27 +190,24 @@ static int l4f00242t03_probe(struct spi_device *spi)
190 return ret; 190 return ret;
191 } 191 }
192 192
193 priv->io_reg = regulator_get(&spi->dev, "vdd"); 193 priv->io_reg = devm_regulator_get(&spi->dev, "vdd");
194 if (IS_ERR(priv->io_reg)) { 194 if (IS_ERR(priv->io_reg)) {
195 dev_err(&spi->dev, "%s: Unable to get the IO regulator\n", 195 dev_err(&spi->dev, "%s: Unable to get the IO regulator\n",
196 __func__); 196 __func__);
197 return PTR_ERR(priv->io_reg); 197 return PTR_ERR(priv->io_reg);
198 } 198 }
199 199
200 priv->core_reg = regulator_get(&spi->dev, "vcore"); 200 priv->core_reg = devm_regulator_get(&spi->dev, "vcore");
201 if (IS_ERR(priv->core_reg)) { 201 if (IS_ERR(priv->core_reg)) {
202 ret = PTR_ERR(priv->core_reg);
203 dev_err(&spi->dev, "%s: Unable to get the core regulator\n", 202 dev_err(&spi->dev, "%s: Unable to get the core regulator\n",
204 __func__); 203 __func__);
205 goto err1; 204 return PTR_ERR(priv->core_reg);
206 } 205 }
207 206
208 priv->ld = lcd_device_register("l4f00242t03", 207 priv->ld = lcd_device_register("l4f00242t03",
209 &spi->dev, priv, &l4f_ops); 208 &spi->dev, priv, &l4f_ops);
210 if (IS_ERR(priv->ld)) { 209 if (IS_ERR(priv->ld))
211 ret = PTR_ERR(priv->ld); 210 return PTR_ERR(priv->ld);
212 goto err2;
213 }
214 211
215 /* Init the LCD */ 212 /* Init the LCD */
216 l4f00242t03_lcd_init(spi); 213 l4f00242t03_lcd_init(spi);
@@ -220,13 +217,6 @@ static int l4f00242t03_probe(struct spi_device *spi)
220 dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n"); 217 dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n");
221 218
222 return 0; 219 return 0;
223
224err2:
225 regulator_put(priv->core_reg);
226err1:
227 regulator_put(priv->io_reg);
228
229 return ret;
230} 220}
231 221
232static int l4f00242t03_remove(struct spi_device *spi) 222static int l4f00242t03_remove(struct spi_device *spi)
@@ -235,12 +225,8 @@ static int l4f00242t03_remove(struct spi_device *spi)
235 225
236 l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN); 226 l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
237 lcd_device_unregister(priv->ld); 227 lcd_device_unregister(priv->ld);
238
239 spi_set_drvdata(spi, NULL); 228 spi_set_drvdata(spi, NULL);
240 229
241 regulator_put(priv->io_reg);
242 regulator_put(priv->core_reg);
243
244 return 0; 230 return 0;
245} 231}
246 232