summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-03-26 16:30:36 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-04-11 16:59:14 +0200
commit1bef2ac893f113107688fc8f90e55d7bad1fcc4a (patch)
tree1a73be1981c05c0ea414cb31341932ebde159378 /drivers/media
parentmedia: stih-cec: Convert to platform remove callback returning void (diff)
downloadlinux-1bef2ac893f113107688fc8f90e55d7bad1fcc4a.tar.xz
linux-1bef2ac893f113107688fc8f90e55d7bad1fcc4a.zip
media: stm32-cec: 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')
-rw-r--r--drivers/media/cec/platform/stm32/stm32-cec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/cec/platform/stm32/stm32-cec.c b/drivers/media/cec/platform/stm32/stm32-cec.c
index 7b2db46a5722..ada3d153362a 100644
--- a/drivers/media/cec/platform/stm32/stm32-cec.c
+++ b/drivers/media/cec/platform/stm32/stm32-cec.c
@@ -344,7 +344,7 @@ err_unprepare_cec_clk:
return ret;
}
-static int stm32_cec_remove(struct platform_device *pdev)
+static void stm32_cec_remove(struct platform_device *pdev)
{
struct stm32_cec *cec = platform_get_drvdata(pdev);
@@ -352,8 +352,6 @@ static int stm32_cec_remove(struct platform_device *pdev)
clk_unprepare(cec->clk_hdmi_cec);
cec_unregister_adapter(cec->adap);
-
- return 0;
}
static const struct of_device_id stm32_cec_of_match[] = {
@@ -364,7 +362,7 @@ MODULE_DEVICE_TABLE(of, stm32_cec_of_match);
static struct platform_driver stm32_cec_driver = {
.probe = stm32_cec_probe,
- .remove = stm32_cec_remove,
+ .remove_new = stm32_cec_remove,
.driver = {
.name = CEC_NAME,
.of_match_table = stm32_cec_of_match,