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

reset: meson-audio-arb: 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>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/dbca07bad345abe7ca421515004987acf1cb41c2.1709674157.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

authored by

Uwe Kleine-König and committed by
Philipp Zabel
b99e9c09 4cece764

+2 -4
+2 -4
drivers/reset/reset-meson-audio-arb.c
··· 120 120 }; 121 121 MODULE_DEVICE_TABLE(of, meson_audio_arb_of_match); 122 122 123 - static int meson_audio_arb_remove(struct platform_device *pdev) 123 + static void meson_audio_arb_remove(struct platform_device *pdev) 124 124 { 125 125 struct meson_audio_arb_data *arb = platform_get_drvdata(pdev); 126 126 ··· 130 130 spin_unlock(&arb->lock); 131 131 132 132 clk_disable_unprepare(arb->clk); 133 - 134 - return 0; 135 133 } 136 134 137 135 static int meson_audio_arb_probe(struct platform_device *pdev) ··· 187 189 188 190 static struct platform_driver meson_audio_arb_pdrv = { 189 191 .probe = meson_audio_arb_probe, 190 - .remove = meson_audio_arb_remove, 192 + .remove_new = meson_audio_arb_remove, 191 193 .driver = { 192 194 .name = "meson-audio-arb-reset", 193 195 .of_match_table = meson_audio_arb_of_match,