]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
backlight: tosa: use devm_lcd_device_register()
authorJingoo Han <jg1.han@samsung.com>
Mon, 16 Dec 2013 23:45:27 +0000 (10:45 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 16 Dec 2013 23:45:27 +0000 (10:45 +1100)
Use devm_lcd_device_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/video/backlight/tosa_lcd.c

index be5d636764bf4bc9b8eec7417c0730dea0914e26..f08d641ccd0103d49ad6421f9473368e1053317b 100644 (file)
@@ -206,8 +206,8 @@ static int tosa_lcd_probe(struct spi_device *spi)
 
        tosa_lcd_tg_on(data);
 
-       data->lcd = lcd_device_register("tosa-lcd", &spi->dev, data,
-                       &tosa_lcd_ops);
+       data->lcd = devm_lcd_device_register(&spi->dev, "tosa-lcd", &spi->dev,
+                                       data, &tosa_lcd_ops);
 
        if (IS_ERR(data->lcd)) {
                ret = PTR_ERR(data->lcd);
@@ -226,8 +226,6 @@ static int tosa_lcd_remove(struct spi_device *spi)
 {
        struct tosa_lcd_data *data = spi_get_drvdata(spi);
 
-       lcd_device_unregister(data->lcd);
-
        if (data->i2c)
                i2c_unregister_device(data->i2c);