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

Input: wm831x-ts - 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-52-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Uwe Kleine-König and committed by
Dmitry Torokhov
33984b4f d722a702

+2 -4
+2 -4
drivers/input/touchscreen/wm831x-ts.c
··· 374 374 return error; 375 375 } 376 376 377 - static int wm831x_ts_remove(struct platform_device *pdev) 377 + static void wm831x_ts_remove(struct platform_device *pdev) 378 378 { 379 379 struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev); 380 380 381 381 free_irq(wm831x_ts->pd_irq, wm831x_ts); 382 382 free_irq(wm831x_ts->data_irq, wm831x_ts); 383 - 384 - return 0; 385 383 } 386 384 387 385 static struct platform_driver wm831x_ts_driver = { ··· 387 389 .name = "wm831x-touch", 388 390 }, 389 391 .probe = wm831x_ts_probe, 390 - .remove = wm831x_ts_remove, 392 + .remove_new = wm831x_ts_remove, 391 393 }; 392 394 module_platform_driver(wm831x_ts_driver); 393 395