summaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-wl1273.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-03-26 16:32:08 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-04-11 16:59:20 +0200
commit8d4de3f79864bf6a256e3591588368d1ec56af5d (patch)
tree252135fe3c3b53c0778e8a31da56179b7073bd86 /drivers/media/radio/radio-wl1273.c
parent070003a89f09167b8921dcfc9cfc3278d1123d73 (diff)
downloadlinux-stable-8d4de3f79864bf6a256e3591588368d1ec56af5d.tar.gz
linux-stable-8d4de3f79864bf6a256e3591588368d1ec56af5d.tar.bz2
linux-stable-8d4de3f79864bf6a256e3591588368d1ec56af5d.zip
media: radio-wl1273: 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/radio-wl1273.c')
-rw-r--r--drivers/media/radio/radio-wl1273.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index 484046471c03..e8166eac9efe 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1977,7 +1977,7 @@ static const struct video_device wl1273_viddev_template = {
V4L2_CAP_RDS_OUTPUT,
};
-static int wl1273_fm_radio_remove(struct platform_device *pdev)
+static void wl1273_fm_radio_remove(struct platform_device *pdev)
{
struct wl1273_device *radio = platform_get_drvdata(pdev);
struct wl1273_core *core = radio->core;
@@ -1990,8 +1990,6 @@ static int wl1273_fm_radio_remove(struct platform_device *pdev)
v4l2_ctrl_handler_free(&radio->ctrl_handler);
video_unregister_device(&radio->videodev);
v4l2_device_unregister(&radio->v4l2dev);
-
- return 0;
}
static int wl1273_fm_radio_probe(struct platform_device *pdev)
@@ -2147,7 +2145,7 @@ pdata_err:
static struct platform_driver wl1273_fm_radio_driver = {
.probe = wl1273_fm_radio_probe,
- .remove = wl1273_fm_radio_remove,
+ .remove_new = wl1273_fm_radio_remove,
.driver = {
.name = "wl1273_fm_radio",
},