]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
backlight: hp680_bl: use devm_backlight_device_register()
authorJingoo Han <jg1.han@samsung.com>
Fri, 3 Jan 2014 03:10:13 +0000 (14:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:10:13 +0000 (14:10 +1100)
Use devm_backlight_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/hp680_bl.c

index 00076ecfe9b8d52adaa09d15d74a1a4aebf0abf1..8ea42b8d9bc8570f3bf379d44bd5c97885e5df2e 100644 (file)
@@ -110,8 +110,8 @@ static int hp680bl_probe(struct platform_device *pdev)
        memset(&props, 0, sizeof(struct backlight_properties));
        props.type = BACKLIGHT_RAW;
        props.max_brightness = HP680_MAX_INTENSITY;
-       bd = backlight_device_register("hp680-bl", &pdev->dev, NULL,
-                                      &hp680bl_ops, &props);
+       bd = devm_backlight_device_register(&pdev->dev, "hp680-bl", &pdev->dev,
+                                       NULL, &hp680bl_ops, &props);
        if (IS_ERR(bd))
                return PTR_ERR(bd);
 
@@ -131,8 +131,6 @@ static int hp680bl_remove(struct platform_device *pdev)
        bd->props.power = 0;
        hp680bl_send_intensity(bd);
 
-       backlight_device_unregister(bd);
-
        return 0;
 }