backlight: l4f00242t03: use devm_lcd_device_register()
authorJingoo Han <jg1.han@samsung.com>
Thu, 23 Jan 2014 23:54:30 +0000 (15:54 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:36:56 +0000 (16:36 -0800)
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/backlight/l4f00242t03.c

index b5fc13bc24e7d1567c8318f55760cb6d6d456bc9..63e763828e0e1a062bdc4c8577eaf3027e4b5564 100644 (file)
@@ -223,8 +223,8 @@ static int l4f00242t03_probe(struct spi_device *spi)
                return PTR_ERR(priv->core_reg);
        }
 
-       priv->ld = lcd_device_register("l4f00242t03",
-                                       &spi->dev, priv, &l4f_ops);
+       priv->ld = devm_lcd_device_register(&spi->dev, "l4f00242t03", &spi->dev,
+                                       priv, &l4f_ops);
        if (IS_ERR(priv->ld))
                return PTR_ERR(priv->ld);
 
@@ -243,8 +243,6 @@ static int l4f00242t03_remove(struct spi_device *spi)
        struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
 
        l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
-       lcd_device_unregister(priv->ld);
-
        return 0;
 }