]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
backlight: lms501kf03: use devm_lcd_device_register()
authorJingoo Han <jg1.han@samsung.com>
Tue, 5 Nov 2013 05:56:36 +0000 (16:56 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:56:36 +0000 (16:56 +1100)
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>
drivers/video/backlight/lms501kf03.c

index ff46e194a117a71fc9179b11c7cf8dee0cdc206d..77258b7b04be288214cba7ee141bf87402c514cf 100644 (file)
@@ -350,8 +350,8 @@ static int lms501kf03_probe(struct spi_device *spi)
                return -EINVAL;
        }
 
-       ld = lcd_device_register("lms501kf03", &spi->dev, lcd,
-                               &lms501kf03_lcd_ops);
+       ld = devm_lcd_device_register(&spi->dev, "lms501kf03", &spi->dev, lcd,
+                                       &lms501kf03_lcd_ops);
        if (IS_ERR(ld))
                return PTR_ERR(ld);
 
@@ -382,8 +382,6 @@ static int lms501kf03_remove(struct spi_device *spi)
        struct lms501kf03 *lcd = spi_get_drvdata(spi);
 
        lms501kf03_power(lcd, FB_BLANK_POWERDOWN);
-       lcd_device_unregister(lcd->ld);
-
        return 0;
 }