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

Configure Feed

Select the types of activity you want to include in your feed.

phy: st: phy-stm32-usbphyc: 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>
Link: https://lore.kernel.org/r/20230307115900.2293120-24-u.kleine-koenig@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Uwe Kleine-König and committed by
Vinod Koul
31d0d4e0 1d558e55

+2 -4
+2 -4
drivers/phy/st/phy-stm32-usbphyc.c
··· 766 766 return ret; 767 767 } 768 768 769 - static int stm32_usbphyc_remove(struct platform_device *pdev) 769 + static void stm32_usbphyc_remove(struct platform_device *pdev) 770 770 { 771 771 struct stm32_usbphyc *usbphyc = dev_get_drvdata(&pdev->dev); 772 772 int port; ··· 779 779 stm32_usbphyc_clk48_unregister(usbphyc); 780 780 781 781 clk_disable_unprepare(usbphyc->clk); 782 - 783 - return 0; 784 782 } 785 783 786 784 static int __maybe_unused stm32_usbphyc_resume(struct device *dev) ··· 808 810 809 811 static struct platform_driver stm32_usbphyc_driver = { 810 812 .probe = stm32_usbphyc_probe, 811 - .remove = stm32_usbphyc_remove, 813 + .remove_new = stm32_usbphyc_remove, 812 814 .driver = { 813 815 .of_match_table = stm32_usbphyc_of_match, 814 816 .name = "stm32-usbphyc",