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

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

authored by

Uwe Kleine-König and committed by
Lee Jones
cba7dfe0 c4c4fa57

+2 -4
+2 -4
drivers/video/backlight/lm3533_bl.c
··· 337 337 return ret; 338 338 } 339 339 340 - static int lm3533_bl_remove(struct platform_device *pdev) 340 + static void lm3533_bl_remove(struct platform_device *pdev) 341 341 { 342 342 struct lm3533_bl *bl = platform_get_drvdata(pdev); 343 343 struct backlight_device *bd = bl->bd; ··· 349 349 350 350 lm3533_ctrlbank_disable(&bl->cb); 351 351 sysfs_remove_group(&bd->dev.kobj, &lm3533_bl_attribute_group); 352 - 353 - return 0; 354 352 } 355 353 356 354 #ifdef CONFIG_PM_SLEEP ··· 388 390 .pm = &lm3533_bl_pm_ops, 389 391 }, 390 392 .probe = lm3533_bl_probe, 391 - .remove = lm3533_bl_remove, 393 + .remove_new = lm3533_bl_remove, 392 394 .shutdown = lm3533_bl_shutdown, 393 395 }; 394 396 module_platform_driver(lm3533_bl_driver);