phy: Convert to platform remove callback returning void
Subsystems (14)
cover phy: Convert to platform remove callback returning void
Hello,
this patch series adapts the platform drivers below drivers/phy to use the .remove_new() callback. Compared to the traditional .remove() callback .remove_new() returns no value. This is a good thing because the driver core doesn't (and cannot) cope for errors during remove. The only effect of a non-zero return value in .remove() is that the driver core emits a warning. The device is removed anyhow and an early return from .remove() usually yields a resource leak.
By changing the remove callback to return void driver authors cannot reasonably assume any more that there is some kind of cleanup later.
All drivers in drivers/spmi returned zero unconditionally in their remove callback, so they could all be converted trivially to .remove_new().
Note that this series depends on commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") which is included in v6.3-rc1.
Best regards
Uwe
Uwe Kleine-König (31):
phy: allwinner: phy-sun4i-usb: Convert to platform remove callback
returning void
phy: broadcom: phy-brcm-usb: Convert to platform remove callback
returning void
phy: cadence: cdns-dphy: Convert to platform remove callback returning
void
phy: cadence: phy-cadence-sierra: Convert to platform remove callback
returning void
phy: cadence: phy-cadence-torrent: Convert to platform remove callback
returning void
phy: freescale: phy-fsl-imx8qm-lvds-phy: Convert to platform remove
callback returning void
phy: intel: phy-intel-lgm-combo: Convert to platform remove callback
returning void
phy: mediatek: phy-mtk-mipi-dsi: Convert to platform remove callback
returning void
phy: motorola: phy-cpcap-usb: Convert to platform remove callback
returning void
phy: motorola: phy-mapphone-mdm6600: Convert to platform remove
callback returning void
phy: phy-lgm-usb: Convert to platform remove callback returning void
phy: qualcomm: phy-qcom-apq8064-sata: Convert to platform remove
callback returning void
phy: qualcomm: phy-qcom-eusb2-repeater: Convert to platform remove
callback returning void
phy: qualcomm: phy-qcom-ipq806x-sata: Convert to platform remove
callback returning void
phy: renesas: phy-rcar-gen3-pcie: Convert to platform remove callback
returning void
phy: renesas: phy-rcar-gen3-usb2: Convert to platform remove callback
returning void
phy: renesas: phy-rcar-gen3-usb3: Convert to platform remove callback
returning void
phy: renesas: r8a779f0-ether-serdes: Convert to platform remove
callback returning void
phy: rockchip: phy-rockchip-inno-csidphy: Convert to platform remove
callback returning void
phy: rockchip: phy-rockchip-inno-dsidphy: Convert to platform remove
callback returning void
phy: rockchip: phy-rockchip-inno-hdmi: Convert to platform remove
callback returning void
phy: rockchip: phy-rockchip-typec: Convert to platform remove callback
returning void
phy: st: phy-stm32-usbphyc: Convert to platform remove callback
returning void
phy: tegra: xusb: Convert to platform remove callback returning void
phy: ti: phy-am654-serdes: Convert to platform remove callback
returning void
phy: ti: phy-da8xx-usb: Convert to platform remove callback returning
void
phy: ti: phy-dm816x-usb: Convert to platform remove callback returning
void
phy: ti: phy-j721e-wiz: Convert to platform remove callback returning
void
phy: ti: phy-omap-usb2: Convert to platform remove callback returning
void
phy: ti: phy-ti-pipe3: Convert to platform remove callback returning
void
phy: ti: phy-twl4030-usb: Convert to platform remove callback
returning void
drivers/phy/allwinner/phy-sun4i-usb.c | 6 ++---- drivers/phy/broadcom/phy-brcm-usb.c | 6 ++---- drivers/phy/cadence/cdns-dphy.c | 6 ++---- drivers/phy/cadence/phy-cadence-sierra.c | 6 ++---- drivers/phy/cadence/phy-cadence-torrent.c | 6 ++---- drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c | 6 ++---- drivers/phy/intel/phy-intel-lgm-combo.c | 5 ++--- drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 5 ++--- drivers/phy/motorola/phy-cpcap-usb.c | 6 ++---- drivers/phy/motorola/phy-mapphone-mdm6600.c | 6 ++---- drivers/phy/phy-lgm-usb.c | 6 ++---- drivers/phy/qualcomm/phy-qcom-apq8064-sata.c | 6 ++---- drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c | 8 +++----- drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c | 6 ++---- drivers/phy/renesas/phy-rcar-gen3-pcie.c | 6 ++---- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 6 ++---- drivers/phy/renesas/phy-rcar-gen3-usb3.c | 6 ++---- drivers/phy/renesas/r8a779f0-ether-serdes.c | 6 ++---- drivers/phy/rockchip/phy-rockchip-inno-csidphy.c | 6 ++---- drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 6 ++---- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 6 ++---- drivers/phy/rockchip/phy-rockchip-typec.c | 6 ++---- drivers/phy/st/phy-stm32-usbphyc.c | 6 ++---- drivers/phy/tegra/xusb.c | 6 ++---- drivers/phy/ti/phy-am654-serdes.c | 6 ++---- drivers/phy/ti/phy-da8xx-usb.c | 6 ++---- drivers/phy/ti/phy-dm816x-usb.c | 6 ++---- drivers/phy/ti/phy-j721e-wiz.c | 6 ++---- drivers/phy/ti/phy-omap-usb2.c | 6 ++---- drivers/phy/ti/phy-ti-pipe3.c | 6 ++---- drivers/phy/ti/phy-twl4030-usb.c | 6 ++---- 31 files changed, 63 insertions(+), 123 deletions(-)
base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
Signature · 1 line
2.39.1
PATCH 1/31 phy: allwinner: phy-sun4i-usb: 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.
--- drivers/phy/allwinner/phy-sun4i-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/allwinner/phy-sun4i-usb.c +2 -4
@@ -698,7 +698,7 @@ static struct phy *sun4i_usb_phy_xlate(struct device *dev,return data->phys[args->args[0 ]].phy; } -static int sun4i_usb_phy_remove (struct platform_device *pdev) +static void sun4i_usb_phy_remove (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct sun4i_usb_phy_data *data =dev_get_drvdata (dev);
@@ -711,8 +711,6 @@ static int sun4i_usb_phy_remove(struct platform_device *pdev)devm_free_irq (dev, data->vbus_det_irq, data);cancel_delayed_work_sync (&data->detect); - -return 0 ; }static const unsigned int sun4i_usb_phy0_cable[] = {
@@ -1054,7 +1052,7 @@ MODULE_DEVICE_TABLE(of, sun4i_usb_phy_of_match);static struct platform_driver sun4i_usb_phy_driver = { .probe = sun4i_usb_phy_probe, - .remove = sun4i_usb_phy_remove, + .remove_new = sun4i_usb_phy_remove, .driver = { .of_match_table = sun4i_usb_phy_of_match, .name ="sun4i-usb-phy" ,
Signature · 1 line
2.39.1
Re: [PATCH 01/31] phy: allwinner: phy-sun4i-usb: Convert to platform remove callback returning void
Dne torek, 07. marec 2023 ob 12:58:30 CET je Uwe Kleine-König napisal(a):
Quoted 8 lines
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.
Quoted 5 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>---
Best regards,
Jernej
Quoted 35 lines
drivers/phy/allwinner/phy-sun4i-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/phy/allwinner/phy-sun4i-usb.cindexfbcd7014ab43..6a74e5ce180a100644drivers/phy/allwinner/phy-sun4i-usb.c +2
-4@@ -698,7 +698,7 @@ static struct phy *sun4i_usb_phy_xlate(struct device *dev, return data->phys[args->args[0]].phy; } -static int sun4i_usb_phy_remove (struct platform_device *pdev) +static void sun4i_usb_phy_remove (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct sun4i_usb_phy_data *data =dev_get_drvdata (dev);@@ -711,8 +711,6 @@ static int sun4i_usb_phy_remove(struct platform_device *pdev) devm_free_irq(dev, data->vbus_det_irq, data);cancel_delayed_work_sync (&data->detect); - -return 0 ; }static const unsigned int sun4i_usb_phy0_cable[] = {@@ -1054,7 +1052,7 @@ MODULE_DEVICE_TABLE(of, sun4i_usb_phy_of_match);static struct platform_driver sun4i_usb_phy_driver = { .probe = sun4i_usb_phy_probe, - .remove = sun4i_usb_phy_remove, + .remove_new = sun4i_usb_phy_remove, .driver = { .of_match_table = sun4i_usb_phy_of_match, .name ="sun4i-usb-phy" ,
PATCH 2/31 phy: broadcom: phy-brcm-usb: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/broadcom/phy-brcm-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/broadcom/phy-brcm-usb.c +2 -4
@@ -572,14 +572,12 @@ static int brcm_usb_phy_probe(struct platform_device *pdev)return PTR_ERR_OR_ZERO (phy_provider); } -static int brcm_usb_phy_remove (struct platform_device *pdev) +static void brcm_usb_phy_remove (struct platform_device *pdev) {struct brcm_usb_phy_data *priv =dev_get_drvdata (&pdev->dev);sysfs_remove_group (&pdev->dev.kobj, &brcm_usb_phy_group);unregister_pm_notifier (&priv->pm_notifier); - -return 0 ; }#ifdef CONFIG_PM_SLEEP
@@ -670,7 +668,7 @@ MODULE_DEVICE_TABLE(of, brcm_usb_dt_ids);static struct platform_driver brcm_usb_driver = { .probe = brcm_usb_phy_probe, - .remove = brcm_usb_phy_remove, + .remove_new = brcm_usb_phy_remove, .driver = { .name ="brcmstb-usb-phy" , .pm = &brcm_usb_phy_pm_ops,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 02/31] phy: broadcom: phy-brcm-usb: Convert to platform remove callback returning void
Quoted 8 lines · Uwe Kleine-König
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.
Quoted 4 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Signature · 7 lines
Florian -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Justin Chen
Reviewed-byRe: [PATCH 02/31] phy: broadcom: phy-brcm-usb: Convert to platform remove callback returning void
Quoted 9 lines · Florian Fainelli
Quoted 8 lines · Uwe Kleine-König
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.
Quoted 6 lines
Quoted 4 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>Reviewed-by Florian Fainelli <[email protected]>
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 3/31 phy: cadence: cdns-dphy: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/cadence/cdns-dphy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/cadence/cdns-dphy.c +2 -4
@@ -456,14 +456,12 @@ static int cdns_dphy_probe(struct platform_device *pdev)return PTR_ERR_OR_ZERO (phy_provider); } -static int cdns_dphy_remove (struct platform_device *pdev) +static void cdns_dphy_remove (struct platform_device *pdev) {struct cdns_dphy *dphy =dev_get_drvdata (&pdev->dev);if (dphy->ops->remove) dphy->ops->remove (dphy); - -return 0 ; }static const struct of_device_id cdns_dphy_of_match[] = {
@@ -475,7 +473,7 @@ MODULE_DEVICE_TABLE(of, cdns_dphy_of_match);static struct platform_driver cdns_dphy_platform_driver = { .probe = cdns_dphy_probe, - .remove = cdns_dphy_remove, + .remove_new = cdns_dphy_remove, .driver = { .name ="cdns-mipi-dphy" , .of_match_table = cdns_dphy_of_match,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 4/31 phy: cadence: phy-cadence-sierra: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/cadence/phy-cadence-sierra.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/cadence/phy-cadence-sierra.c +2 -4
@@ -1513,7 +1513,7 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)return ret; } -static int cdns_sierra_phy_remove (struct platform_device *pdev) +static void cdns_sierra_phy_remove (struct platform_device *pdev) {struct cdns_sierra_phy *phy =platform_get_drvdata (pdev);int i;
@@ -1533,8 +1533,6 @@ static int cdns_sierra_phy_remove(struct platform_device *pdev) }cdns_sierra_clk_unregister (phy); - -return 0 ; }/* QSGMII PHY PMA lane configuration */
@@ -2520,7 +2518,7 @@ MODULE_DEVICE_TABLE(of, cdns_sierra_id_table);static struct platform_driver cdns_sierra_driver = { .probe = cdns_sierra_phy_probe, - .remove = cdns_sierra_phy_remove, + .remove_new = cdns_sierra_phy_remove, .driver = { .name ="cdns-sierra-phy" , .of_match_table = cdns_sierra_id_table,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 5/31 phy: cadence: phy-cadence-torrent: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/cadence/phy-cadence-torrent.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/cadence/phy-cadence-torrent.c +2 -4
@@ -2777,7 +2777,7 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev)return ret; } -static int cdns_torrent_phy_remove (struct platform_device *pdev) +static void cdns_torrent_phy_remove (struct platform_device *pdev) {struct cdns_torrent_phy *cdns_phy =platform_get_drvdata (pdev);int i;
@@ -2791,8 +2791,6 @@ static int cdns_torrent_phy_remove(struct platform_device *pdev)clk_disable_unprepare (cdns_phy->clk);cdns_torrent_clk_cleanup (cdns_phy); - -return 0 ; }/* Single DisplayPort(DP) link configuration */
@@ -4708,7 +4706,7 @@ MODULE_DEVICE_TABLE(of, cdns_torrent_phy_of_match);static struct platform_driver cdns_torrent_phy_driver = { .probe = cdns_torrent_phy_probe, - .remove = cdns_torrent_phy_remove, + .remove_new = cdns_torrent_phy_remove, .driver = { .name ="cdns-torrent-phy" , .of_match_table = cdns_torrent_phy_of_match,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 6/31 phy: freescale: phy-fsl-imx8qm-lvds-phy: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c +2 -4
@@ -391,11 +391,9 @@ static int mixel_lvds_phy_probe(struct platform_device *pdev)return ret; } -static int mixel_lvds_phy_remove (struct platform_device *pdev) +static void mixel_lvds_phy_remove (struct platform_device *pdev) {pm_runtime_disable (&pdev->dev); - -return 0 ; }static int __maybe_unused mixel_lvds_phy_runtime_suspend (struct device *dev)
@@ -436,7 +434,7 @@ MODULE_DEVICE_TABLE(of, mixel_lvds_phy_of_match);static struct platform_driver mixel_lvds_phy_driver = { .probe = mixel_lvds_phy_probe, - .remove = mixel_lvds_phy_remove, + .remove_new = mixel_lvds_phy_remove, .driver = { .pm = &mixel_lvds_phy_pm_ops, .name ="mixel-lvds-phy" ,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 7/31 phy: intel: phy-intel-lgm-combo: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/intel/phy-intel-lgm-combo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/phy/intel/phy-intel-lgm-combo.c +2 -3
@@ -589,13 +589,12 @@ static int intel_cbphy_probe(struct platform_device *pdev)return intel_cbphy_create (cbphy); } -static int intel_cbphy_remove (struct platform_device *pdev) +static void intel_cbphy_remove (struct platform_device *pdev) {struct intel_combo_phy *cbphy =platform_get_drvdata (pdev);intel_cbphy_rst_assert (cbphy);clk_disable_unprepare (cbphy->core_clk); -return 0 ; }static const struct of_device_id of_intel_cbphy_match[] = {
@@ -606,7 +605,7 @@ static const struct of_device_id of_intel_cbphy_match[] = {static struct platform_driver intel_cbphy_driver = { .probe = intel_cbphy_probe, - .remove = intel_cbphy_remove, + .remove_new = intel_cbphy_remove, .driver = { .name ="intel-combo-phy" , .of_match_table = of_intel_cbphy_match,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 8/31 phy: mediatek: phy-mtk-mipi-dsi: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/phy/mediatek/phy-mtk-mipi-dsi.c +2 -3
@@ -180,10 +180,9 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev) mipi_tx->pll); } -static int mtk_mipi_tx_remove (struct platform_device *pdev) +static void mtk_mipi_tx_remove (struct platform_device *pdev) {of_clk_del_provider (pdev->dev.of_node); -return 0 ; }static const struct of_device_id mtk_mipi_tx_match[] = {
@@ -199,7 +198,7 @@ MODULE_DEVICE_TABLE(of, mtk_mipi_tx_match);static struct platform_driver mtk_mipi_tx_driver = { .probe = mtk_mipi_tx_probe, - .remove = mtk_mipi_tx_remove, + .remove_new = mtk_mipi_tx_remove, .driver = { .name ="mediatek-mipi-tx" , .of_match_table = mtk_mipi_tx_match,
Signature · 1 line
2.39.1
PATCH 9/31 phy: motorola: phy-cpcap-usb: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/motorola/phy-cpcap-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/motorola/phy-cpcap-usb.c +2 -4
@@ -692,7 +692,7 @@ static int cpcap_usb_phy_probe(struct platform_device *pdev)return error; } -static int cpcap_usb_phy_remove (struct platform_device *pdev) +static void cpcap_usb_phy_remove (struct platform_device *pdev) {struct cpcap_phy_ddata *ddata =platform_get_drvdata (pdev);int error;
@@ -707,13 +707,11 @@ static int cpcap_usb_phy_remove(struct platform_device *pdev)usb_remove_phy (&ddata->phy);cancel_delayed_work_sync (&ddata->detect_work);regulator_disable (ddata->vusb); - -return 0 ; }static struct platform_driver cpcap_usb_phy_driver = { .probe = cpcap_usb_phy_probe, - .remove = cpcap_usb_phy_remove, + .remove_new = cpcap_usb_phy_remove, .driver = { .name ="cpcap-usb-phy" , .of_match_table =of_match_ptr (cpcap_usb_phy_id_table),
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 10/31 phy: motorola: phy-mapphone-mdm6600: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/motorola/phy-mapphone-mdm6600.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/motorola/phy-mapphone-mdm6600.c +2 -4
@@ -634,7 +634,7 @@ static int phy_mdm6600_probe(struct platform_device *pdev)return error; } -static int phy_mdm6600_remove (struct platform_device *pdev) +static void phy_mdm6600_remove (struct platform_device *pdev) {struct phy_mdm6600 *ddata =platform_get_drvdata (pdev);struct gpio_desc *reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET ];
@@ -653,13 +653,11 @@ static int phy_mdm6600_remove(struct platform_device *pdev)cancel_delayed_work_sync (&ddata->modem_wake_work);cancel_delayed_work_sync (&ddata->bootup_work);cancel_delayed_work_sync (&ddata->status_work); - -return 0 ; }static struct platform_driver phy_mdm6600_driver = { .probe = phy_mdm6600_probe, - .remove = phy_mdm6600_remove, + .remove_new = phy_mdm6600_remove, .driver = { .name ="phy-mapphone-mdm6600" , .pm = &phy_mdm6600_pm_ops,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 11/31 phy: phy-lgm-usb: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/phy-lgm-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/phy-lgm-usb.c +2 -4
@@ -252,13 +252,11 @@ static int phy_probe(struct platform_device *pdev)return usb_add_phy_dev (phy); } -static int phy_remove (struct platform_device *pdev) +static void phy_remove (struct platform_device *pdev) {struct tca_apb *ta =platform_get_drvdata (pdev);usb_remove_phy (&ta->phy); - -return 0 ; }static const struct of_device_id intel_usb_phy_dt_ids[] = {
@@ -273,7 +271,7 @@ static struct platform_driver lgm_phy_driver = { .of_match_table = intel_usb_phy_dt_ids, }, .probe = phy_probe, - .remove = phy_remove, + .remove_new = phy_remove, };module_platform_driver (lgm_phy_driver);
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 12/31 phy: qualcomm: phy-qcom-apq8064-sata: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/qualcomm/phy-qcom-apq8064-sata.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/qualcomm/phy-qcom-apq8064-sata.c +2 -4
@@ -243,13 +243,11 @@ static int qcom_apq8064_sata_phy_probe(struct platform_device *pdev)return 0 ; } -static int qcom_apq8064_sata_phy_remove (struct platform_device *pdev) +static void qcom_apq8064_sata_phy_remove (struct platform_device *pdev) {struct qcom_apq8064_sata_phy *phy =platform_get_drvdata (pdev);clk_disable_unprepare (phy->cfg_clk); - -return 0 ; }static const struct of_device_id qcom_apq8064_sata_phy_of_match[] = {
@@ -260,7 +258,7 @@ MODULE_DEVICE_TABLE(of, qcom_apq8064_sata_phy_of_match);static struct platform_driver qcom_apq8064_sata_phy_driver = { .probe = qcom_apq8064_sata_phy_probe, - .remove = qcom_apq8064_sata_phy_remove, + .remove_new = qcom_apq8064_sata_phy_remove, .driver = { .name ="qcom-apq8064-sata-phy" , .of_match_table = qcom_apq8064_sata_phy_of_match,
Signature · 1 line
2.39.1
PATCH 13/31 phy: qualcomm: phy-qcom-eusb2-repeater: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c +3 -5
@@ -223,16 +223,14 @@ static int eusb2_repeater_probe(struct platform_device *pdev)return 0 ; } -static int eusb2_repeater_remove (struct platform_device *pdev) +static void eusb2_repeater_remove (struct platform_device *pdev) {struct eusb2_repeater *rptr =platform_get_drvdata (pdev);if (!rptr) -return 0 ; +return ;eusb2_repeater_exit (rptr->phy); - -return 0 ; }static const struct of_device_id eusb2_repeater_of_match_table[] = {
@@ -246,7 +244,7 @@ MODULE_DEVICE_TABLE(of, eusb2_repeater_of_match_table);static struct platform_driver eusb2_repeater_driver = { .probe = eusb2_repeater_probe, - .remove = eusb2_repeater_remove, + .remove_new = eusb2_repeater_remove, .driver = { .name ="qcom-eusb2-repeater" , .of_match_table = eusb2_repeater_of_match_table,
Signature · 1 line
2.39.1
PATCH 14/31 phy: qualcomm: phy-qcom-ipq806x-sata: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/qualcomm/phy-qcom-ipq806x-sata.c +2 -4
@@ -170,13 +170,11 @@ static int qcom_ipq806x_sata_phy_probe(struct platform_device *pdev)return 0 ; } -static int qcom_ipq806x_sata_phy_remove (struct platform_device *pdev) +static void qcom_ipq806x_sata_phy_remove (struct platform_device *pdev) {struct qcom_ipq806x_sata_phy *phy =platform_get_drvdata (pdev);clk_disable_unprepare (phy->cfg_clk); - -return 0 ; }static const struct of_device_id qcom_ipq806x_sata_phy_of_match[] = {
@@ -187,7 +185,7 @@ MODULE_DEVICE_TABLE(of, qcom_ipq806x_sata_phy_of_match);static struct platform_driver qcom_ipq806x_sata_phy_driver = { .probe = qcom_ipq806x_sata_phy_probe, - .remove = qcom_ipq806x_sata_phy_remove, + .remove_new = qcom_ipq806x_sata_phy_remove, .driver = { .name ="qcom-ipq806x-sata-phy" , .of_match_table = qcom_ipq806x_sata_phy_of_match,
Signature · 1 line
2.39.1
PATCH 15/31 phy: renesas: phy-rcar-gen3-pcie: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/renesas/phy-rcar-gen3-pcie.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/renesas/phy-rcar-gen3-pcie.c +2 -4
@@ -126,11 +126,9 @@ static int rcar_gen3_phy_pcie_probe(struct platform_device *pdev)return error; } -static int rcar_gen3_phy_pcie_remove (struct platform_device *pdev) +static void rcar_gen3_phy_pcie_remove (struct platform_device *pdev) {pm_runtime_disable (&pdev->dev); - -return 0 ; };static struct platform_driver rcar_gen3_phy_driver = {
@@ -139,7 +137,7 @@ static struct platform_driver rcar_gen3_phy_driver = { .of_match_table = rcar_gen3_phy_pcie_match_table, }, .probe = rcar_gen3_phy_pcie_probe, - .remove = rcar_gen3_phy_pcie_remove, + .remove_new = rcar_gen3_phy_pcie_remove, };module_platform_driver (rcar_gen3_phy_driver);
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 16/31 phy: renesas: phy-rcar-gen3-usb2: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/renesas/phy-rcar-gen3-usb2.c +2 -4
@@ -755,7 +755,7 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)return ret; } -static int rcar_gen3_phy_usb2_remove (struct platform_device *pdev) +static void rcar_gen3_phy_usb2_remove (struct platform_device *pdev) {struct rcar_gen3_chan *channel =platform_get_drvdata (pdev);
@@ -763,8 +763,6 @@ static int rcar_gen3_phy_usb2_remove(struct platform_device *pdev)device_remove_file (&pdev->dev, &dev_attr_role);pm_runtime_disable (&pdev->dev); - -return 0 ; };static struct platform_driver rcar_gen3_phy_usb2_driver = {
@@ -773,7 +771,7 @@ static struct platform_driver rcar_gen3_phy_usb2_driver = { .of_match_table = rcar_gen3_phy_usb2_match_table, }, .probe = rcar_gen3_phy_usb2_probe, - .remove = rcar_gen3_phy_usb2_remove, + .remove_new = rcar_gen3_phy_usb2_remove, };module_platform_driver (rcar_gen3_phy_usb2_driver);
Signature · 1 line
2.39.1
Re: [PATCH 16/31] phy: renesas: phy-rcar-gen3-usb2: Convert to platform remove callback returning void
Quoted 8 lines · Uwe Kleine-König
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.
Quoted 4 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
PATCH 17/31 phy: renesas: phy-rcar-gen3-usb3: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/renesas/phy-rcar-gen3-usb3.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/renesas/phy-rcar-gen3-usb3.c +2 -4
@@ -199,11 +199,9 @@ static int rcar_gen3_phy_usb3_probe(struct platform_device *pdev)return ret; } -static int rcar_gen3_phy_usb3_remove (struct platform_device *pdev) +static void rcar_gen3_phy_usb3_remove (struct platform_device *pdev) {pm_runtime_disable (&pdev->dev); - -return 0 ; };static struct platform_driver rcar_gen3_phy_usb3_driver = {
@@ -212,7 +210,7 @@ static struct platform_driver rcar_gen3_phy_usb3_driver = { .of_match_table = rcar_gen3_phy_usb3_match_table, }, .probe = rcar_gen3_phy_usb3_probe, - .remove = rcar_gen3_phy_usb3_remove, + .remove_new = rcar_gen3_phy_usb3_remove, };module_platform_driver (rcar_gen3_phy_usb3_driver);
Signature · 1 line
2.39.1
Re: [PATCH 17/31] phy: renesas: phy-rcar-gen3-usb3: Convert to platform remove callback returning void
Quoted 8 lines · Uwe Kleine-König
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.
Quoted 4 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
PATCH 18/31 phy: renesas: r8a779f0-ether-serdes: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/renesas/r8a779f0-ether-serdes.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/renesas/r8a779f0-ether-serdes.c +2 -4
@@ -388,19 +388,17 @@ static int r8a779f0_eth_serdes_probe(struct platform_device *pdev)return 0 ; } -static int r8a779f0_eth_serdes_remove (struct platform_device *pdev) +static void r8a779f0_eth_serdes_remove (struct platform_device *pdev) {pm_runtime_put (&pdev->dev);pm_runtime_disable (&pdev->dev);platform_set_drvdata (pdev,NULL ); - -return 0 ; }static struct platform_driver r8a779f0_eth_serdes_driver_platform = { .probe = r8a779f0_eth_serdes_probe, - .remove = r8a779f0_eth_serdes_remove, + .remove_new = r8a779f0_eth_serdes_remove, .driver = { .name ="r8a779f0_eth_serdes" , .of_match_table = r8a779f0_eth_serdes_of_table,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 19/31 phy: rockchip: phy-rockchip-inno-csidphy: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/rockchip/phy-rockchip-inno-csidphy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/rockchip/phy-rockchip-inno-csidphy.c +2 -4
@@ -459,13 +459,11 @@ static int rockchip_inno_csidphy_probe(struct platform_device *pdev)return 0 ; } -static int rockchip_inno_csidphy_remove (struct platform_device *pdev) +static void rockchip_inno_csidphy_remove (struct platform_device *pdev) {struct rockchip_inno_csidphy *priv =platform_get_drvdata (pdev);pm_runtime_disable (priv->dev); - -return 0 ; }static struct platform_driver rockchip_inno_csidphy_driver = {
@@ -474,7 +472,7 @@ static struct platform_driver rockchip_inno_csidphy_driver = { .of_match_table = rockchip_inno_csidphy_match_id, }, .probe = rockchip_inno_csidphy_probe, - .remove = rockchip_inno_csidphy_remove, + .remove_new = rockchip_inno_csidphy_remove, };module_platform_driver (rockchip_inno_csidphy_driver);
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 19/31] phy: rockchip: phy-rockchip-inno-csidphy: Convert to platform remove callback returning void
Am Dienstag, 7. März 2023, 12:58:48 CET schrieb Uwe Kleine-König:
Quoted 8 lines
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.
Quoted 4 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 20/31 phy: rockchip: phy-rockchip-inno-dsidphy: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c +2 -4
@@ -755,13 +755,11 @@ static int inno_dsidphy_probe(struct platform_device *pdev)return 0 ; } -static int inno_dsidphy_remove (struct platform_device *pdev) +static void inno_dsidphy_remove (struct platform_device *pdev) {struct inno_dsidphy *inno =platform_get_drvdata (pdev);pm_runtime_disable (inno->dev); - -return 0 ; }static const struct of_device_id inno_dsidphy_of_match[] = {
@@ -788,7 +786,7 @@ static struct platform_driver inno_dsidphy_driver = { .of_match_table = of_match_ptr(inno_dsidphy_of_match), }, .probe = inno_dsidphy_probe, - .remove = inno_dsidphy_remove, + .remove_new = inno_dsidphy_remove, };module_platform_driver (inno_dsidphy_driver);
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 20/31] phy: rockchip: phy-rockchip-inno-dsidphy: Convert to platform remove callback returning void
Am Dienstag, 7. März 2023, 12:58:49 CET schrieb Uwe Kleine-König:
Quoted 8 lines
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.
Quoted 4 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 21/31 phy: rockchip: phy-rockchip-inno-hdmi: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/rockchip/phy-rockchip-inno-hdmi.c +2 -4
@@ -1246,11 +1246,9 @@ static int inno_hdmi_phy_probe(struct platform_device *pdev)return PTR_ERR_OR_ZERO (phy_provider); } -static int inno_hdmi_phy_remove (struct platform_device *pdev) +static void inno_hdmi_phy_remove (struct platform_device *pdev) {of_clk_del_provider (pdev->dev.of_node); - -return 0 ; }static const struct of_device_id inno_hdmi_phy_of_match[] = {
@@ -1266,7 +1264,7 @@ MODULE_DEVICE_TABLE(of, inno_hdmi_phy_of_match);static struct platform_driver inno_hdmi_phy_driver = { .probe = inno_hdmi_phy_probe, - .remove = inno_hdmi_phy_remove, + .remove_new = inno_hdmi_phy_remove, .driver = { .name ="inno-hdmi-phy" , .of_match_table = inno_hdmi_phy_of_match,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 21/31] phy: rockchip: phy-rockchip-inno-hdmi: Convert to platform remove callback returning void
Am Dienstag, 7. März 2023, 12:58:50 CET schrieb Uwe Kleine-König:
Quoted 8 lines
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.
Quoted 4 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 22/31 phy: rockchip: phy-rockchip-typec: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/rockchip/phy-rockchip-typec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/rockchip/phy-rockchip-typec.c +2 -4
@@ -1194,11 +1194,9 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)return 0 ; } -static int rockchip_typec_phy_remove (struct platform_device *pdev) +static void rockchip_typec_phy_remove (struct platform_device *pdev) {pm_runtime_disable (&pdev->dev); - -return 0 ; }static const struct of_device_id rockchip_typec_phy_dt_ids[] = {
@@ -1213,7 +1211,7 @@ MODULE_DEVICE_TABLE(of, rockchip_typec_phy_dt_ids);static struct platform_driver rockchip_typec_phy_driver = { .probe = rockchip_typec_phy_probe, - .remove = rockchip_typec_phy_remove, + .remove_new = rockchip_typec_phy_remove, .driver = { .name ="rockchip-typec-phy" , .of_match_table = rockchip_typec_phy_dt_ids,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH 22/31] phy: rockchip: phy-rockchip-typec: Convert to platform remove callback returning void
Am Dienstag, 7. März 2023, 12:58:51 CET schrieb Uwe Kleine-König:
Quoted 8 lines
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.
Quoted 4 lines
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by Uwe Kleine-König <[email protected]>
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 23/31 phy: st: phy-stm32-usbphyc: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/st/phy-stm32-usbphyc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/st/phy-stm32-usbphyc.c +2 -4
@@ -766,7 +766,7 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)return ret; } -static int stm32_usbphyc_remove (struct platform_device *pdev) +static void stm32_usbphyc_remove (struct platform_device *pdev) {struct stm32_usbphyc *usbphyc =dev_get_drvdata (&pdev->dev);int port;
@@ -779,8 +779,6 @@ static int stm32_usbphyc_remove(struct platform_device *pdev)stm32_usbphyc_clk48_unregister (usbphyc);clk_disable_unprepare (usbphyc->clk); - -return 0 ; }static int __maybe_unused stm32_usbphyc_resume (struct device *dev)
@@ -810,7 +808,7 @@ MODULE_DEVICE_TABLE(of, stm32_usbphyc_of_match);static struct platform_driver stm32_usbphyc_driver = { .probe = stm32_usbphyc_probe, - .remove = stm32_usbphyc_remove, + .remove_new = stm32_usbphyc_remove, .driver = { .of_match_table = stm32_usbphyc_of_match, .name ="stm32-usbphyc" ,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 24/31 phy: tegra: xusb: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/tegra/xusb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/tegra/xusb.c +2 -4
@@ -1267,7 +1267,7 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)return err; } -static int tegra_xusb_padctl_remove (struct platform_device *pdev) +static void tegra_xusb_padctl_remove (struct platform_device *pdev) {struct tegra_xusb_padctl *padctl =platform_get_drvdata (pdev);int err;
@@ -1285,8 +1285,6 @@ static int tegra_xusb_padctl_remove(struct platform_device *pdev)dev_err (&pdev->dev,"failed to assert reset: %d\n" , err); padctl->soc->ops->remove (padctl); - -return 0 ; }static __maybe_unused int tegra_xusb_padctl_suspend_noirq (struct device *dev)
@@ -1321,7 +1319,7 @@ static struct platform_driver tegra_xusb_padctl_driver = { .pm = &tegra_xusb_padctl_pm_ops, }, .probe = tegra_xusb_padctl_probe, - .remove = tegra_xusb_padctl_remove, + .remove_new = tegra_xusb_padctl_remove, };module_platform_driver (tegra_xusb_padctl_driver);
Signature · 1 line
2.39.1
PATCH 25/31 phy: ti: phy-am654-serdes: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/ti/phy-am654-serdes.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/ti/phy-am654-serdes.c +2 -4
@@ -842,20 +842,18 @@ static int serdes_am654_probe(struct platform_device *pdev)return ret; } -static int serdes_am654_remove (struct platform_device *pdev) +static void serdes_am654_remove (struct platform_device *pdev) {struct serdes_am654 *am654_phy =platform_get_drvdata (pdev);struct device_node *node = am654_phy->of_node;pm_runtime_disable (&pdev->dev);of_clk_del_provider (node); - -return 0 ; }static struct platform_driver serdes_am654_driver = { .probe = serdes_am654_probe, - .remove = serdes_am654_remove, + .remove_new = serdes_am654_remove, .driver = { .name ="phy-am654" , .of_match_table = serdes_am654_id_table,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 26/31 phy: ti: phy-da8xx-usb: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/ti/phy-da8xx-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/ti/phy-da8xx-usb.c +2 -4
@@ -211,7 +211,7 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)return 0 ; } -static int da8xx_usb_phy_remove (struct platform_device *pdev) +static void da8xx_usb_phy_remove (struct platform_device *pdev) {struct da8xx_usb_phy *d_phy =platform_get_drvdata (pdev);
@@ -219,8 +219,6 @@ static int da8xx_usb_phy_remove(struct platform_device *pdev)phy_remove_lookup (d_phy->usb20_phy,"usb-phy" ,"musb-da8xx" );phy_remove_lookup (d_phy->usb11_phy,"usb-phy" ,"ohci-da8xx" ); } - -return 0 ; }static const struct of_device_id da8xx_usb_phy_ids[] = {
@@ -231,7 +229,7 @@ MODULE_DEVICE_TABLE(of, da8xx_usb_phy_ids);static struct platform_driver da8xx_usb_phy_driver = { .probe = da8xx_usb_phy_probe, - .remove = da8xx_usb_phy_remove, + .remove_new = da8xx_usb_phy_remove, .driver = { .name ="da8xx-usb-phy" , .of_match_table = da8xx_usb_phy_ids,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 27/31 phy: ti: phy-dm816x-usb: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/ti/phy-dm816x-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/ti/phy-dm816x-usb.c +2 -4
@@ -257,20 +257,18 @@ static int dm816x_usb_phy_probe(struct platform_device *pdev)return error; } -static int dm816x_usb_phy_remove (struct platform_device *pdev) +static void dm816x_usb_phy_remove (struct platform_device *pdev) {struct dm816x_usb_phy *phy =platform_get_drvdata (pdev);usb_remove_phy (&phy->phy);pm_runtime_disable (phy->dev);clk_unprepare (phy->refclk); - -return 0 ; }static struct platform_driver dm816x_usb_phy_driver = { .probe = dm816x_usb_phy_probe, - .remove = dm816x_usb_phy_remove, + .remove_new = dm816x_usb_phy_remove, .driver = { .name ="dm816x-usb-phy" , .pm = &dm816x_usb_phy_pm_ops,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 28/31 phy: ti: phy-j721e-wiz: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/ti/phy-j721e-wiz.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/ti/phy-j721e-wiz.c +2 -4
@@ -1636,7 +1636,7 @@ static int wiz_probe(struct platform_device *pdev)return ret; } -static int wiz_remove (struct platform_device *pdev) +static void wiz_remove (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct device_node *node = dev->of_node;
@@ -1650,13 +1650,11 @@ static int wiz_remove(struct platform_device *pdev)wiz_clock_cleanup (wiz, node);pm_runtime_put (dev);pm_runtime_disable (dev); - -return 0 ; }static struct platform_driver wiz_driver = { .probe = wiz_probe, - .remove = wiz_remove, + .remove_new = wiz_remove, .driver = { .name ="wiz" , .of_match_table = wiz_id_table,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 29/31 phy: ti: phy-omap-usb2: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/ti/phy-omap-usb2.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/ti/phy-omap-usb2.c +2 -4
@@ -506,19 +506,17 @@ static int omap_usb2_probe(struct platform_device *pdev)return 0 ; } -static int omap_usb2_remove (struct platform_device *pdev) +static void omap_usb2_remove (struct platform_device *pdev) {struct omap_usb *phy =platform_get_drvdata (pdev);usb_remove_phy (&phy->phy);pm_runtime_disable (phy->dev); - -return 0 ; }static struct platform_driver omap_usb2_driver = { .probe = omap_usb2_probe, - .remove = omap_usb2_remove, + .remove_new = omap_usb2_remove, .driver = { .name ="omap-usb2" , .of_match_table = omap_usb2_id_table,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 30/31 phy: ti: phy-ti-pipe3: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/ti/phy-ti-pipe3.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/ti/phy-ti-pipe3.c +2 -4
@@ -841,7 +841,7 @@ static int ti_pipe3_probe(struct platform_device *pdev)return PTR_ERR_OR_ZERO (phy_provider); } -static int ti_pipe3_remove (struct platform_device *pdev) +static void ti_pipe3_remove (struct platform_device *pdev) {struct ti_pipe3 *phy =platform_get_drvdata (pdev);
@@ -850,8 +850,6 @@ static int ti_pipe3_remove(struct platform_device *pdev) phy->sata_refclk_enabled = false; }pm_runtime_disable (&pdev->dev); - -return 0 ; }static int ti_pipe3_enable_clocks (struct ti_pipe3 *phy)
@@ -928,7 +926,7 @@ MODULE_DEVICE_TABLE(of, ti_pipe3_id_table);static struct platform_driver ti_pipe3_driver = { .probe = ti_pipe3_probe, - .remove = ti_pipe3_remove, + .remove_new = ti_pipe3_remove, .driver = { .name ="ti-pipe3" , .of_match_table = ti_pipe3_id_table,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
PATCH 31/31 phy: ti: phy-twl4030-usb: Convert to platform remove callback returning void
In reply to Uwe Kleine-KönigThe .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.
--- drivers/phy/ti/phy-twl4030-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/phy/ti/phy-twl4030-usb.c +2 -4
@@ -787,7 +787,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)return 0 ; } -static int twl4030_usb_remove (struct platform_device *pdev) +static void twl4030_usb_remove (struct platform_device *pdev) {struct twl4030_usb *twl =platform_get_drvdata (pdev);int val;
@@ -821,8 +821,6 @@ static int twl4030_usb_remove(struct platform_device *pdev)/* disable complete OTG block */ twl4030_usb_clear_bits (twl,POWER_CTRL ,POWER_CTRL_OTG_ENAB ); - -return 0 ; }#ifdef CONFIG_OF
@@ -835,7 +833,7 @@ MODULE_DEVICE_TABLE(of, twl4030_usb_id_table);static struct platform_driver twl4030_usb_driver = { .probe = twl4030_usb_probe, - .remove = twl4030_usb_remove, + .remove_new = twl4030_usb_remove, .driver = { .name ="twl4030_usb" , .pm = &twl4030_usb_pm_ops,
Signature · 7 lines
2.39.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 10 lines · Uwe Kleine-König
Hello,
this patch series adapts the platform drivers below
drivers/phyto use the .remove_new() callback. Compared to the traditional .remove() callback .remove_new() returns no value. This is a good thing because the driver core doesn't (and cannot) cope for errors during remove. The only effect of a non-zero return value in .remove() is that the driver core emits a warning. The device is removed anyhow and an early return from .remove() usually yields a resource leak.
Quoted 8 lines
By changing the remove callback to return void driver authors cannot reasonably assume any more that there is some kind of cleanup later.
All drivers in
drivers/spmireturned zero unconditionally in their remove callback, so they could all be converted trivially to .remove_new().Note that this series depends on commit
5c5a7680e67b("platform: Provide a remove callback that returns no value") which is included in v6.3-rc1.
Applied, thanks
Signature · 1 line
~Vinod