Commit 0524fc51 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

backlight: tdo24m: 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 1f9ca1ee
......@@ -385,7 +385,7 @@ static int tdo24m_probe(struct spi_device *spi)
return -EINVAL;
}
lcd->lcd_dev = lcd_device_register("tdo24m", &spi->dev,
lcd->lcd_dev = devm_lcd_device_register(&spi->dev, "tdo24m", &spi->dev,
lcd, &tdo24m_ops);
if (IS_ERR(lcd->lcd_dev))
return PTR_ERR(lcd->lcd_dev);
......@@ -393,13 +393,9 @@ static int tdo24m_probe(struct spi_device *spi)
spi_set_drvdata(spi, lcd);
err = tdo24m_power(lcd, FB_BLANK_UNBLANK);
if (err)
goto out_unregister;
return err;
return 0;
out_unregister:
lcd_device_unregister(lcd->lcd_dev);
return err;
}
static int tdo24m_remove(struct spi_device *spi)
......@@ -407,8 +403,6 @@ static int tdo24m_remove(struct spi_device *spi)
struct tdo24m *lcd = spi_get_drvdata(spi);
tdo24m_power(lcd, FB_BLANK_POWERDOWN);
lcd_device_unregister(lcd->lcd_dev);
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