Skip to content

Commit ea379bc

Browse files
Uwe Kleine-Königlag-linaro
authored andcommitted
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
1 parent 0a4606a commit ea379bc

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/video/backlight/qcom-wled.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,16 +1717,14 @@ static int wled_probe(struct platform_device *pdev)
17171717
return PTR_ERR_OR_ZERO(bl);
17181718
};
17191719

1720-
static int wled_remove(struct platform_device *pdev)
1720+
static void wled_remove(struct platform_device *pdev)
17211721
{
17221722
struct wled *wled = platform_get_drvdata(pdev);
17231723

17241724
mutex_destroy(&wled->lock);
17251725
cancel_delayed_work_sync(&wled->ovp_work);
17261726
disable_irq(wled->short_irq);
17271727
disable_irq(wled->ovp_irq);
1728-
1729-
return 0;
17301728
}
17311729

17321730
static const struct of_device_id wled_match_table[] = {
@@ -1743,7 +1741,7 @@ MODULE_DEVICE_TABLE(of, wled_match_table);
17431741

17441742
static struct platform_driver wled_driver = {
17451743
.probe = wled_probe,
1746-
.remove = wled_remove,
1744+
.remove_new = wled_remove,
17471745
.driver = {
17481746
.name = "qcom,wled",
17491747
.of_match_table = wled_match_table,

0 commit comments

Comments
 (0)