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

reset: rzg2l-usbphy-ctrl: 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/e75fb1af5c7df5fc4073a26a99ba88633503910d.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
7f5aa02a b99e9c09

+2 -4
+2 -4
drivers/reset/reset-rzg2l-usbphy-ctrl.c
··· 156 156 return 0; 157 157 } 158 158 159 - static int rzg2l_usbphy_ctrl_remove(struct platform_device *pdev) 159 + static void rzg2l_usbphy_ctrl_remove(struct platform_device *pdev) 160 160 { 161 161 struct rzg2l_usbphy_ctrl_priv *priv = dev_get_drvdata(&pdev->dev); 162 162 163 163 pm_runtime_put(&pdev->dev); 164 164 pm_runtime_disable(&pdev->dev); 165 165 reset_control_assert(priv->rstc); 166 - 167 - return 0; 168 166 } 169 167 170 168 static struct platform_driver rzg2l_usbphy_ctrl_driver = { ··· 171 173 .of_match_table = rzg2l_usbphy_ctrl_match_table, 172 174 }, 173 175 .probe = rzg2l_usbphy_ctrl_probe, 174 - .remove = rzg2l_usbphy_ctrl_remove, 176 + .remove_new = rzg2l_usbphy_ctrl_remove, 175 177 }; 176 178 module_platform_driver(rzg2l_usbphy_ctrl_driver); 177 179