backlight: ili922x: use devm_lcd_device_register()
Use devm_lcd_device_register() to make cleanup paths simpler. 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>
This commit is contained in:
parent
ea5092c890
commit
a7e9e3ffd7
1 changed files with 2 additions and 5 deletions
|
@ -513,8 +513,8 @@ static int ili922x_probe(struct spi_device *spi)
|
||||||
|
|
||||||
ili->power = FB_BLANK_POWERDOWN;
|
ili->power = FB_BLANK_POWERDOWN;
|
||||||
|
|
||||||
lcd = lcd_device_register("ili922xlcd", &spi->dev, ili,
|
lcd = devm_lcd_device_register(&spi->dev, "ili922xlcd", &spi->dev, ili,
|
||||||
&ili922x_ops);
|
&ili922x_ops);
|
||||||
if (IS_ERR(lcd)) {
|
if (IS_ERR(lcd)) {
|
||||||
dev_err(&spi->dev, "cannot register LCD\n");
|
dev_err(&spi->dev, "cannot register LCD\n");
|
||||||
return PTR_ERR(lcd);
|
return PTR_ERR(lcd);
|
||||||
|
@ -530,10 +530,7 @@ static int ili922x_probe(struct spi_device *spi)
|
||||||
|
|
||||||
static int ili922x_remove(struct spi_device *spi)
|
static int ili922x_remove(struct spi_device *spi)
|
||||||
{
|
{
|
||||||
struct ili922x *ili = spi_get_drvdata(spi);
|
|
||||||
|
|
||||||
ili922x_poweroff(spi);
|
ili922x_poweroff(spi);
|
||||||
lcd_device_unregister(ili->ld);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue