Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

backlight: tosa: use devm_backlight_device_register()

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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jingoo Han and committed by
Linus Torvalds
ffb1f6c8 443956fd

+3 -4
+3 -4
drivers/video/backlight/tosa_bl.c
··· 105 105 memset(&props, 0, sizeof(struct backlight_properties)); 106 106 props.type = BACKLIGHT_RAW; 107 107 props.max_brightness = 512 - 1; 108 - data->bl = backlight_device_register("tosa-bl", &client->dev, data, 109 - &bl_ops, &props); 108 + data->bl = devm_backlight_device_register(&client->dev, "tosa-bl", 109 + &client->dev, data, &bl_ops, 110 + &props); 110 111 if (IS_ERR(data->bl)) { 111 112 ret = PTR_ERR(data->bl); 112 113 goto err_reg; ··· 129 128 { 130 129 struct tosa_bl_data *data = i2c_get_clientdata(client); 131 130 132 - backlight_device_unregister(data->bl); 133 131 data->bl = NULL; 134 - 135 132 return 0; 136 133 } 137 134