Skip to content

Commit ee3d559

Browse files
Uwe Kleine-Königdtor
authored andcommitted
Input: wm831x-on - 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230920125829.1478827-28-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent ad43716 commit ee3d559

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/input/misc/wm831x-on.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,18 @@ static int wm831x_on_probe(struct platform_device *pdev)
123123
return ret;
124124
}
125125

126-
static int wm831x_on_remove(struct platform_device *pdev)
126+
static void wm831x_on_remove(struct platform_device *pdev)
127127
{
128128
struct wm831x_on *wm831x_on = platform_get_drvdata(pdev);
129129
int irq = platform_get_irq(pdev, 0);
130130

131131
free_irq(irq, wm831x_on);
132132
cancel_delayed_work_sync(&wm831x_on->work);
133-
134-
return 0;
135133
}
136134

137135
static struct platform_driver wm831x_on_driver = {
138136
.probe = wm831x_on_probe,
139-
.remove = wm831x_on_remove,
137+
.remove_new = wm831x_on_remove,
140138
.driver = {
141139
.name = "wm831x-on",
142140
},

0 commit comments

Comments
 (0)