Commit e8796d9f authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

backlight: ltv350qv: use devm_lcd_device_register()

Use devm_lcd_device_register() to make cleanup paths simpler.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8358741a
...@@ -242,7 +242,8 @@ static int ltv350qv_probe(struct spi_device *spi) ...@@ -242,7 +242,8 @@ static int ltv350qv_probe(struct spi_device *spi)
if (!lcd->buffer) if (!lcd->buffer)
return -ENOMEM; return -ENOMEM;
ld = lcd_device_register("ltv350qv", &spi->dev, lcd, &ltv_ops); ld = devm_lcd_device_register(&spi->dev, "ltv350qv", &spi->dev, lcd,
&ltv_ops);
if (IS_ERR(ld)) if (IS_ERR(ld))
return PTR_ERR(ld); return PTR_ERR(ld);
...@@ -250,15 +251,11 @@ static int ltv350qv_probe(struct spi_device *spi) ...@@ -250,15 +251,11 @@ static int ltv350qv_probe(struct spi_device *spi)
ret = ltv350qv_power(lcd, FB_BLANK_UNBLANK); ret = ltv350qv_power(lcd, FB_BLANK_UNBLANK);
if (ret) if (ret)
goto out_unregister; return ret;
spi_set_drvdata(spi, lcd); spi_set_drvdata(spi, lcd);
return 0; return 0;
out_unregister:
lcd_device_unregister(ld);
return ret;
} }
static int ltv350qv_remove(struct spi_device *spi) static int ltv350qv_remove(struct spi_device *spi)
...@@ -266,8 +263,6 @@ static int ltv350qv_remove(struct spi_device *spi) ...@@ -266,8 +263,6 @@ static int ltv350qv_remove(struct spi_device *spi)
struct ltv350qv *lcd = spi_get_drvdata(spi); struct ltv350qv *lcd = spi_get_drvdata(spi);
ltv350qv_power(lcd, FB_BLANK_POWERDOWN); ltv350qv_power(lcd, FB_BLANK_POWERDOWN);
lcd_device_unregister(lcd->ld);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment