Skip to content

Commit 8b339ca

Browse files
Uwe Kleine-Königlag-linaro
authored andcommitted
backlight: aat2870_bl: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230308073945.2336302-2-u.kleine-koenig@pengutronix.de
1 parent 10258bf commit 8b339ca

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/video/backlight/aat2870_bl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,24 +178,22 @@ static int aat2870_bl_probe(struct platform_device *pdev)
178178
return ret;
179179
}
180180

181-
static int aat2870_bl_remove(struct platform_device *pdev)
181+
static void aat2870_bl_remove(struct platform_device *pdev)
182182
{
183183
struct aat2870_bl_driver_data *aat2870_bl = platform_get_drvdata(pdev);
184184
struct backlight_device *bd = aat2870_bl->bd;
185185

186186
bd->props.power = FB_BLANK_POWERDOWN;
187187
bd->props.brightness = 0;
188188
backlight_update_status(bd);
189-
190-
return 0;
191189
}
192190

193191
static struct platform_driver aat2870_bl_driver = {
194192
.driver = {
195193
.name = "aat2870-backlight",
196194
},
197195
.probe = aat2870_bl_probe,
198-
.remove = aat2870_bl_remove,
196+
.remove_new = aat2870_bl_remove,
199197
};
200198

201199
static int __init aat2870_bl_init(void)

0 commit comments

Comments
 (0)