From: Jingoo Han Date: Tue, 12 Nov 2013 23:09:12 +0000 (-0800) Subject: backlight: bd6107: use devm_backlight_device_register() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=26faf15cc650c6f30687c3e3c22d480bb1e3542b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git backlight: bd6107: use devm_backlight_device_register() Use devm_backlight_device_register() to make cleanup paths simpler. Signed-off-by: Jingoo Han Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c index 43c434e7dc86..16dd9bc625bd 100644 --- a/drivers/video/backlight/bd6107.c +++ b/drivers/video/backlight/bd6107.c @@ -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; }