diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-03-26 16:32:10 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-04-11 16:59:20 +0200 |
commit | 66774df1545d909c22436fad58a1d4c4d49fe6d2 (patch) | |
tree | 7577c0f14f312f3f54b76d55f37c58ca880d6b57 /drivers/media/rc | |
parent | 3c1dd02566e168f6abc59a27fdb545050a748a42 (diff) |
media: gpio-ir-recv: 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>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/gpio-ir-recv.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index 8dbe780dae4e..fb037788ec10 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c @@ -126,7 +126,7 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) "gpio-ir-recv-irq", gpio_dev); } -static int gpio_ir_recv_remove(struct platform_device *pdev) +static void gpio_ir_recv_remove(struct platform_device *pdev) { struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); struct device *pmdev = gpio_dev->pmdev; @@ -139,8 +139,6 @@ static int gpio_ir_recv_remove(struct platform_device *pdev) pm_runtime_put_noidle(pmdev); pm_runtime_set_suspended(pmdev); } - - return 0; } #ifdef CONFIG_PM @@ -202,7 +200,7 @@ MODULE_DEVICE_TABLE(of, gpio_ir_recv_of_match); static struct platform_driver gpio_ir_recv_driver = { .probe = gpio_ir_recv_probe, - .remove = gpio_ir_recv_remove, + .remove_new = gpio_ir_recv_remove, .driver = { .name = KBUILD_MODNAME, .of_match_table = of_match_ptr(gpio_ir_recv_of_match), |