diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-11-12 15:09:32 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 12:09:20 +0900 |
commit | 0524fc5194e548a4fe32d87850b976e0ec4e9007 (patch) | |
tree | 8e2be6428b2f11f291433993f29ab950ff1ab2a3 /drivers/video/backlight | |
parent | 1f9ca1eee8e93cacf1bff11dc3fdd01b7fd80cd7 (diff) | |
download | op-kernel-dev-0524fc5194e548a4fe32d87850b976e0ec4e9007.zip op-kernel-dev-0524fc5194e548a4fe32d87850b976e0ec4e9007.tar.gz |
backlight: tdo24m: 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>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/tdo24m.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/video/backlight/tdo24m.c b/drivers/video/backlight/tdo24m.c index 2ccfa46..908016f 100644 --- a/drivers/video/backlight/tdo24m.c +++ b/drivers/video/backlight/tdo24m.c @@ -385,21 +385,17 @@ static int tdo24m_probe(struct spi_device *spi) return -EINVAL; } - lcd->lcd_dev = lcd_device_register("tdo24m", &spi->dev, - lcd, &tdo24m_ops); + 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); 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; } |