mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
backlight: bd6107: use devm_backlight_device_register()
Use devm_backlight_device_register() to make cleanup paths simpler. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
3e61c73c52
commit
26faf15cc6
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue