Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: img-ir-core: 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>

authored by

Uwe Kleine-König and committed by
Hans Verkuil
f6fc05fa 66774df1

+2 -3
+2 -3
drivers/media/rc/img-ir/img-ir-core.c
··· 152 152 return error; 153 153 } 154 154 155 - static int img_ir_remove(struct platform_device *pdev) 155 + static void img_ir_remove(struct platform_device *pdev) 156 156 { 157 157 struct img_ir_priv *priv = platform_get_drvdata(pdev); 158 158 ··· 164 164 clk_disable_unprepare(priv->clk); 165 165 if (!IS_ERR(priv->sys_clk)) 166 166 clk_disable_unprepare(priv->sys_clk); 167 - return 0; 168 167 } 169 168 170 169 static SIMPLE_DEV_PM_OPS(img_ir_pmops, img_ir_suspend, img_ir_resume); ··· 181 182 .pm = &img_ir_pmops, 182 183 }, 183 184 .probe = img_ir_probe, 184 - .remove = img_ir_remove, 185 + .remove_new = img_ir_remove, 185 186 }; 186 187 187 188 module_platform_driver(img_ir_driver);