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

backlight: sky81452-backlight: 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-14-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Lee Jones
541ec23c 20c111d2

+2 -4
+2 -4
drivers/video/backlight/sky81452-backlight.c
··· 311 311 return ret; 312 312 } 313 313 314 - static int sky81452_bl_remove(struct platform_device *pdev) 314 + static void sky81452_bl_remove(struct platform_device *pdev) 315 315 { 316 316 const struct sky81452_bl_platform_data *pdata = 317 317 dev_get_platdata(&pdev->dev); ··· 325 325 326 326 if (pdata->gpiod_enable) 327 327 gpiod_set_value_cansleep(pdata->gpiod_enable, 0); 328 - 329 - return 0; 330 328 } 331 329 332 330 #ifdef CONFIG_OF ··· 341 343 .of_match_table = of_match_ptr(sky81452_bl_of_match), 342 344 }, 343 345 .probe = sky81452_bl_probe, 344 - .remove = sky81452_bl_remove, 346 + .remove_new = sky81452_bl_remove, 345 347 }; 346 348 347 349 module_platform_driver(sky81452_bl_driver);