diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-02-25 16:54:52 +0100 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2024-05-09 01:03:38 +0900 |
commit | 6d472f20c3c00a6fe61fd97646ffc627a697c760 (patch) | |
tree | 181406e69c28d26b211dd729de3be4db22bf97e3 /drivers/extcon | |
parent | 67d4b2cedca0c2a5b75576d1d8d7c7e78a15308d (diff) | |
download | linux-stable-6d472f20c3c00a6fe61fd97646ffc627a697c760.tar.gz linux-stable-6d472f20c3c00a6fe61fd97646ffc627a697c760.tar.bz2 linux-stable-6d472f20c3c00a6fe61fd97646ffc627a697c760.zip |
extcon: intel-mrfld: 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.
Link: https://lore.kernel.org/lkml/7223e19152980ef553e38cf56c2b38ec099586e0.1708876186.git.u.kleine-koenig@pengutronix.de/
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/extcon-intel-mrfld.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/extcon/extcon-intel-mrfld.c b/drivers/extcon/extcon-intel-mrfld.c index 718fe374f95d..a1f737f13d49 100644 --- a/drivers/extcon/extcon-intel-mrfld.c +++ b/drivers/extcon/extcon-intel-mrfld.c @@ -257,13 +257,11 @@ static int mrfld_extcon_probe(struct platform_device *pdev) return 0; } -static int mrfld_extcon_remove(struct platform_device *pdev) +static void mrfld_extcon_remove(struct platform_device *pdev) { struct mrfld_extcon_data *data = platform_get_drvdata(pdev); mrfld_extcon_sw_control(data, false); - - return 0; } static const struct platform_device_id mrfld_extcon_id_table[] = { @@ -277,7 +275,7 @@ static struct platform_driver mrfld_extcon_driver = { .name = "mrfld_bcove_pwrsrc", }, .probe = mrfld_extcon_probe, - .remove = mrfld_extcon_remove, + .remove_new = mrfld_extcon_remove, .id_table = mrfld_extcon_id_table, }; module_platform_driver(mrfld_extcon_driver); |