linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/31] phy: allwinner: phy-sun4i-usb: Convert to platform remove callback returning void
       [not found] <20230307115900.2293120-1-u.kleine-koenig@pengutronix.de>
@ 2023-03-07 11:58 ` Uwe Kleine-König
  2023-03-14 20:11   ` Jernej Škrabec
  2023-03-07 11:58 ` [PATCH 06/31] phy: freescale: phy-fsl-imx8qm-lvds-phy: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2023-03-07 11:58 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Andre Przywara, Wolfram Sang, Icenowy Zheng
  Cc: linux-phy, linux-arm-kernel, linux-sunxi, kernel

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>
---
 drivers/phy/allwinner/phy-sun4i-usb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index fbcd7014ab43..6a74e5ce180a 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -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",
-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 06/31] phy: freescale: phy-fsl-imx8qm-lvds-phy: Convert to platform remove callback returning void
       [not found] <20230307115900.2293120-1-u.kleine-koenig@pengutronix.de>
  2023-03-07 11:58 ` [PATCH 01/31] phy: allwinner: phy-sun4i-usb: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-07 11:58 ` Uwe Kleine-König
  2023-03-07 11:58 ` [PATCH 08/31] phy: mediatek: phy-mtk-mipi-dsi: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2023-03-07 11:58 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Shawn Guo, Sascha Hauer,
	Liu Ying
  Cc: Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team, linux-phy,
	linux-arm-kernel

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>
---
 drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c b/drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c
index e514b64bfdab..0ae052df3765 100644
--- a/drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c
+++ b/drivers/phy/freescale/phy-fsl-imx8qm-lvds-phy.c
@@ -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",
-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 08/31] phy: mediatek: phy-mtk-mipi-dsi: Convert to platform remove callback returning void
       [not found] <20230307115900.2293120-1-u.kleine-koenig@pengutronix.de>
  2023-03-07 11:58 ` [PATCH 01/31] phy: allwinner: phy-sun4i-usb: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-07 11:58 ` [PATCH 06/31] phy: freescale: phy-fsl-imx8qm-lvds-phy: " Uwe Kleine-König
@ 2023-03-07 11:58 ` Uwe Kleine-König
  2023-03-07 11:58 ` [PATCH 19/31] phy: rockchip: phy-rockchip-inno-csidphy: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2023-03-07 11:58 UTC (permalink / raw)
  To: Chun-Kuang Hu, Philipp Zabel, Chunfeng Yun, Vinod Koul,
	Kishon Vijay Abraham I, Matthias Brugger
  Cc: AngeloGioacchino Del Regno, dri-devel, linux-mediatek,
	linux-arm-kernel, linux-phy, kernel

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>
---
 drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
index cf9c386385bb..526c05a4af5e 100644
--- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
+++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
@@ -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,
-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 19/31] phy: rockchip: phy-rockchip-inno-csidphy: Convert to platform remove callback returning void
       [not found] <20230307115900.2293120-1-u.kleine-koenig@pengutronix.de>
                   ` (2 preceding siblings ...)
  2023-03-07 11:58 ` [PATCH 08/31] phy: mediatek: phy-mtk-mipi-dsi: " Uwe Kleine-König
@ 2023-03-07 11:58 ` Uwe Kleine-König
  2023-03-07 12:02   ` Heiko Stübner
  2023-03-07 11:58 ` [PATCH 20/31] phy: rockchip: phy-rockchip-inno-dsidphy: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2023-03-07 11:58 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Heiko Stuebner
  Cc: linux-phy, linux-arm-kernel, linux-rockchip, kernel

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>
---
 drivers/phy/rockchip/phy-rockchip-inno-csidphy.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
index 75f948bdea6a..98c92d6c482f 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-csidphy.c
@@ -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);
-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 20/31] phy: rockchip: phy-rockchip-inno-dsidphy: Convert to platform remove callback returning void
       [not found] <20230307115900.2293120-1-u.kleine-koenig@pengutronix.de>
                   ` (3 preceding siblings ...)
  2023-03-07 11:58 ` [PATCH 19/31] phy: rockchip: phy-rockchip-inno-csidphy: " Uwe Kleine-König
@ 2023-03-07 11:58 ` Uwe Kleine-König
  2023-03-07 12:02   ` Heiko Stübner
  2023-03-07 11:58 ` [PATCH 21/31] phy: rockchip: phy-rockchip-inno-hdmi: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2023-03-07 11:58 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Heiko Stuebner
  Cc: linux-phy, linux-arm-kernel, linux-rockchip, kernel

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>
---
 drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
index 2c5847faff63..726928ff1273 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
@@ -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);
 
-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 21/31] phy: rockchip: phy-rockchip-inno-hdmi: Convert to platform remove callback returning void
       [not found] <20230307115900.2293120-1-u.kleine-koenig@pengutronix.de>
                   ` (4 preceding siblings ...)
  2023-03-07 11:58 ` [PATCH 20/31] phy: rockchip: phy-rockchip-inno-dsidphy: " Uwe Kleine-König
@ 2023-03-07 11:58 ` Uwe Kleine-König
  2023-03-07 12:02   ` Heiko Stübner
  2023-03-07 11:58 ` [PATCH 22/31] phy: rockchip: phy-rockchip-typec: " Uwe Kleine-König
  2023-03-07 11:58 ` [PATCH 23/31] phy: st: phy-stm32-usbphyc: " Uwe Kleine-König
  7 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2023-03-07 11:58 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Heiko Stuebner
  Cc: linux-phy, linux-arm-kernel, linux-rockchip, kernel

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>
---
 drivers/phy/rockchip/phy-rockchip-inno-hdmi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
index 80acca4e9e14..1e1563f5fffc 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c
@@ -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,
-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 22/31] phy: rockchip: phy-rockchip-typec: Convert to platform remove callback returning void
       [not found] <20230307115900.2293120-1-u.kleine-koenig@pengutronix.de>
                   ` (5 preceding siblings ...)
  2023-03-07 11:58 ` [PATCH 21/31] phy: rockchip: phy-rockchip-inno-hdmi: " Uwe Kleine-König
@ 2023-03-07 11:58 ` Uwe Kleine-König
  2023-03-07 12:02   ` Heiko Stübner
  2023-03-07 11:58 ` [PATCH 23/31] phy: st: phy-stm32-usbphyc: " Uwe Kleine-König
  7 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2023-03-07 11:58 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Heiko Stuebner
  Cc: linux-phy, linux-arm-kernel, linux-rockchip, kernel

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>
---
 drivers/phy/rockchip/phy-rockchip-typec.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
index 39db8acde61a..8b1667be4915 100644
--- a/drivers/phy/rockchip/phy-rockchip-typec.c
+++ b/drivers/phy/rockchip/phy-rockchip-typec.c
@@ -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,
-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 23/31] phy: st: phy-stm32-usbphyc: Convert to platform remove callback returning void
       [not found] <20230307115900.2293120-1-u.kleine-koenig@pengutronix.de>
                   ` (6 preceding siblings ...)
  2023-03-07 11:58 ` [PATCH 22/31] phy: rockchip: phy-rockchip-typec: " Uwe Kleine-König
@ 2023-03-07 11:58 ` Uwe Kleine-König
  7 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2023-03-07 11:58 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Maxime Coquelin,
	Alexandre Torgue, Amelie Delaunay, Dan Carpenter, Fabrice Gasnier
  Cc: linux-phy, linux-stm32, linux-arm-kernel, kernel

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>
---
 drivers/phy/st/phy-stm32-usbphyc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
index 5bb9647b078f..1add3b75f92f 100644
--- a/drivers/phy/st/phy-stm32-usbphyc.c
+++ b/drivers/phy/st/phy-stm32-usbphyc.c
@@ -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",
-- 
2.39.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 19/31] phy: rockchip: phy-rockchip-inno-csidphy: Convert to platform remove callback returning void
  2023-03-07 11:58 ` [PATCH 19/31] phy: rockchip: phy-rockchip-inno-csidphy: " Uwe Kleine-König
@ 2023-03-07 12:02   ` Heiko Stübner
  0 siblings, 0 replies; 13+ messages in thread
From: Heiko Stübner @ 2023-03-07 12:02 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Uwe Kleine-König
  Cc: linux-phy, linux-arm-kernel, linux-rockchip, kernel

Am Dienstag, 7. März 2023, 12:58:48 CET schrieb 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.
> 
> 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: Heiko Stuebner <heiko@sntech.de>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 20/31] phy: rockchip: phy-rockchip-inno-dsidphy: Convert to platform remove callback returning void
  2023-03-07 11:58 ` [PATCH 20/31] phy: rockchip: phy-rockchip-inno-dsidphy: " Uwe Kleine-König
@ 2023-03-07 12:02   ` Heiko Stübner
  0 siblings, 0 replies; 13+ messages in thread
From: Heiko Stübner @ 2023-03-07 12:02 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Uwe Kleine-König
  Cc: linux-phy, linux-arm-kernel, linux-rockchip, kernel

Am Dienstag, 7. März 2023, 12:58:49 CET schrieb 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.
> 
> 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: Heiko Stuebner <heiko@sntech.de>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 21/31] phy: rockchip: phy-rockchip-inno-hdmi: Convert to platform remove callback returning void
  2023-03-07 11:58 ` [PATCH 21/31] phy: rockchip: phy-rockchip-inno-hdmi: " Uwe Kleine-König
@ 2023-03-07 12:02   ` Heiko Stübner
  0 siblings, 0 replies; 13+ messages in thread
From: Heiko Stübner @ 2023-03-07 12:02 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Uwe Kleine-König
  Cc: linux-phy, linux-arm-kernel, linux-rockchip, kernel

Am Dienstag, 7. März 2023, 12:58:50 CET schrieb 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.
> 
> 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: Heiko Stuebner <heiko@sntech.de>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 22/31] phy: rockchip: phy-rockchip-typec: Convert to platform remove callback returning void
  2023-03-07 11:58 ` [PATCH 22/31] phy: rockchip: phy-rockchip-typec: " Uwe Kleine-König
@ 2023-03-07 12:02   ` Heiko Stübner
  0 siblings, 0 replies; 13+ messages in thread
From: Heiko Stübner @ 2023-03-07 12:02 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Uwe Kleine-König
  Cc: linux-phy, linux-arm-kernel, linux-rockchip, kernel

Am Dienstag, 7. März 2023, 12:58:51 CET schrieb 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.
> 
> 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: Heiko Stuebner <heiko@sntech.de>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 01/31] phy: allwinner: phy-sun4i-usb: Convert to platform remove callback returning void
  2023-03-07 11:58 ` [PATCH 01/31] phy: allwinner: phy-sun4i-usb: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-14 20:11   ` Jernej Škrabec
  0 siblings, 0 replies; 13+ messages in thread
From: Jernej Škrabec @ 2023-03-14 20:11 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Chen-Yu Tsai, Samuel Holland,
	Andre Przywara, Wolfram Sang, Icenowy Zheng,
	Uwe Kleine-König
  Cc: linux-phy, linux-arm-kernel, linux-sunxi, kernel

Dne torek, 07. marec 2023 ob 12:58:30 CET je Uwe Kleine-König napisal(a):
> 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>
> ---

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

>  drivers/phy/allwinner/phy-sun4i-usb.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c
> b/drivers/phy/allwinner/phy-sun4i-usb.c index fbcd7014ab43..6a74e5ce180a
> 100644
> --- a/drivers/phy/allwinner/phy-sun4i-usb.c
> +++ b/drivers/phy/allwinner/phy-sun4i-usb.c
> @@ -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",





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-03-14 20:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230307115900.2293120-1-u.kleine-koenig@pengutronix.de>
2023-03-07 11:58 ` [PATCH 01/31] phy: allwinner: phy-sun4i-usb: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-14 20:11   ` Jernej Škrabec
2023-03-07 11:58 ` [PATCH 06/31] phy: freescale: phy-fsl-imx8qm-lvds-phy: " Uwe Kleine-König
2023-03-07 11:58 ` [PATCH 08/31] phy: mediatek: phy-mtk-mipi-dsi: " Uwe Kleine-König
2023-03-07 11:58 ` [PATCH 19/31] phy: rockchip: phy-rockchip-inno-csidphy: " Uwe Kleine-König
2023-03-07 12:02   ` Heiko Stübner
2023-03-07 11:58 ` [PATCH 20/31] phy: rockchip: phy-rockchip-inno-dsidphy: " Uwe Kleine-König
2023-03-07 12:02   ` Heiko Stübner
2023-03-07 11:58 ` [PATCH 21/31] phy: rockchip: phy-rockchip-inno-hdmi: " Uwe Kleine-König
2023-03-07 12:02   ` Heiko Stübner
2023-03-07 11:58 ` [PATCH 22/31] phy: rockchip: phy-rockchip-typec: " Uwe Kleine-König
2023-03-07 12:02   ` Heiko Stübner
2023-03-07 11:58 ` [PATCH 23/31] phy: st: phy-stm32-usbphyc: " Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).