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

backlight: qcom-wled: 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-12-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Lee Jones
ea379bc8 0a4606a7

+2 -4
+2 -4
drivers/video/backlight/qcom-wled.c
··· 1717 1717 return PTR_ERR_OR_ZERO(bl); 1718 1718 }; 1719 1719 1720 - static int wled_remove(struct platform_device *pdev) 1720 + static void wled_remove(struct platform_device *pdev) 1721 1721 { 1722 1722 struct wled *wled = platform_get_drvdata(pdev); 1723 1723 ··· 1725 1725 cancel_delayed_work_sync(&wled->ovp_work); 1726 1726 disable_irq(wled->short_irq); 1727 1727 disable_irq(wled->ovp_irq); 1728 - 1729 - return 0; 1730 1728 } 1731 1729 1732 1730 static const struct of_device_id wled_match_table[] = { ··· 1741 1743 1742 1744 static struct platform_driver wled_driver = { 1743 1745 .probe = wled_probe, 1744 - .remove = wled_remove, 1746 + .remove_new = wled_remove, 1745 1747 .driver = { 1746 1748 .name = "qcom,wled", 1747 1749 .of_match_table = wled_match_table,