summaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-03-26 16:32:09 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-04-11 16:59:20 +0200
commit3c1dd02566e168f6abc59a27fdb545050a748a42 (patch)
tree14fab8dcd43f895009d8c40bc6dd9f825d3ea721 /drivers/media/radio
parentmedia: radio-wl1273: Convert to platform remove callback returning void (diff)
downloadlinux-3c1dd02566e168f6abc59a27fdb545050a748a42.tar.xz
linux-3c1dd02566e168f6abc59a27fdb545050a748a42.zip
media: radio-platform-si4713: 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/radio')
-rw-r--r--drivers/media/radio/si4713/radio-platform-si4713.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/radio/si4713/radio-platform-si4713.c b/drivers/media/radio/si4713/radio-platform-si4713.c
index 433f9642786d..9fdaed68a962 100644
--- a/drivers/media/radio/si4713/radio-platform-si4713.c
+++ b/drivers/media/radio/si4713/radio-platform-si4713.c
@@ -190,7 +190,7 @@ exit:
}
/* radio_si4713_pdriver_remove - remove the device */
-static int radio_si4713_pdriver_remove(struct platform_device *pdev)
+static void radio_si4713_pdriver_remove(struct platform_device *pdev)
{
struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev);
struct radio_si4713_device *rsdev;
@@ -198,8 +198,6 @@ static int radio_si4713_pdriver_remove(struct platform_device *pdev)
rsdev = container_of(v4l2_dev, struct radio_si4713_device, v4l2_dev);
video_unregister_device(&rsdev->radio_dev);
v4l2_device_unregister(&rsdev->v4l2_dev);
-
- return 0;
}
static struct platform_driver radio_si4713_pdriver = {
@@ -207,7 +205,7 @@ static struct platform_driver radio_si4713_pdriver = {
.name = "radio-si4713",
},
.probe = radio_si4713_pdriver_probe,
- .remove = radio_si4713_pdriver_remove,
+ .remove_new = radio_si4713_pdriver_remove,
};
module_platform_driver(radio_si4713_pdriver);