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

interconnect: imx8mp: 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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>
Link: https://lore.kernel.org/r/20231031222851.3126434-15-u.kleine-koenig@pengutronix.de
Signed-off-by: Georgi Djakov <djakov@kernel.org>

authored by

Uwe Kleine-König and committed by
Georgi Djakov
12384b76 1841d085

+1 -8
+1 -8
drivers/interconnect/imx/imx8mp.c
··· 239 239 return imx_icc_register(pdev, nodes, ARRAY_SIZE(nodes), noc_setting_nodes); 240 240 } 241 241 242 - static int imx8mp_icc_remove(struct platform_device *pdev) 243 - { 244 - imx_icc_unregister(pdev); 245 - 246 - return 0; 247 - } 248 - 249 242 static struct platform_driver imx8mp_icc_driver = { 250 243 .probe = imx8mp_icc_probe, 251 - .remove = imx8mp_icc_remove, 244 + .remove_new = imx_icc_unregister, 252 245 .driver = { 253 246 .name = "imx8mp-interconnect", 254 247 },