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

index 43c434e7dc8651cd152321884bf8154da5d37068..16dd9bc625bdf22951b47f886391469e2647f99b 100644 (file)
@@ -166,7 +166,8 @@ static int bd6107_probe(struct i2c_client *client,
        props.brightness = clamp_t(unsigned int, pdata->def_value, 0,
                                   props.max_brightness);
 
-       backlight = backlight_device_register(dev_name(&client->dev),
+       backlight = devm_backlight_device_register(&client->dev,
+                                             dev_name(&client->dev),
                                              &bd->client->dev, bd,
                                              &bd6107_backlight_ops, &props);
        if (IS_ERR(backlight)) {
@@ -186,7 +187,6 @@ static int bd6107_remove(struct i2c_client *client)
 
        backlight->props.brightness = 0;
        backlight_update_status(backlight);
-       backlight_device_unregister(backlight);
 
        return 0;
 }