linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/17] phy: allwinner: convert to devm_platform_ioremap_resource(_byname)
@ 2020-10-29  2:54 Chunfeng Yun
  2020-10-29  2:54 ` [PATCH 02/17] phy: amlogic: convert to devm_platform_ioremap_resource Chunfeng Yun
                   ` (15 more replies)
  0 siblings, 16 replies; 24+ messages in thread
From: Chunfeng Yun @ 2020-10-29  2:54 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul
  Cc: Ondrej Jirman, Peter Chen, Neil Armstrong, Anil Varughese,
	Wei Yongjun, Lorenzo Pieralisi, Fabio Estevam, Jerome Brunet,
	Florian Fainelli, Kevin Hilman, Krzysztof Kozlowski,
	Rayagonda Kokatanur, Chen-Yu Tsai, bcm-kernel-feedback-list,
	NXP Linux Team, Chunfeng Yun, Icenowy Zheng, Bharat Gooty,
	Martin Blumenstingl, Ray Jui, Sascha Hauer, Maxime Ripard,
	Yue Wang, Lubomir Rintel, Remi Pommarel, linux-mediatek,
	Rikard Falkeborn, Matthias Brugger, linux-amlogic,
	linux-arm-kernel, Roger Quadros, Hanjie Lin, Ma Feng,
	Scott Branden, Randy Dunlap, Jyri Sarha, linux-kernel,
	Sanket Parmar, Pengutronix Kernel Team, Joe Perches,
	Colin Ian King, Shawn Guo, Li Jun

Use devm_platform_ioremap_resource(_byname) to simplify code

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/phy/allwinner/phy-sun4i-usb.c       | 8 ++------
 drivers/phy/allwinner/phy-sun50i-usb3.c     | 4 +---
 drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 4 +---
 drivers/phy/allwinner/phy-sun9i-usb.c       | 4 +---
 4 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index 651d5e2a25ce..406d5943f8a8 100644
--- a/drivers/phy/allwinner/phy-sun4i-usb.c
+++ b/drivers/phy/allwinner/phy-sun4i-usb.c
@@ -686,7 +686,6 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
 	struct phy_provider *phy_provider;
-	struct resource *res;
 	int i, ret;
 
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
@@ -700,8 +699,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
 	if (!data->cfg)
 		return -EINVAL;
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_ctrl");
-	data->base = devm_ioremap_resource(dev, res);
+	data->base = devm_platform_ioremap_resource_byname(pdev, "phy_ctrl");
 	if (IS_ERR(data->base))
 		return PTR_ERR(data->base);
 
@@ -796,9 +794,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
 
 		if (i || data->cfg->phy0_dual_route) { /* No pmu for musb */
 			snprintf(name, sizeof(name), "pmu%d", i);
-			res = platform_get_resource_byname(pdev,
-							IORESOURCE_MEM, name);
-			phy->pmu = devm_ioremap_resource(dev, res);
+			phy->pmu = devm_platform_ioremap_resource_byname(pdev, name);
 			if (IS_ERR(phy->pmu))
 				return PTR_ERR(phy->pmu);
 		}
diff --git a/drivers/phy/allwinner/phy-sun50i-usb3.c b/drivers/phy/allwinner/phy-sun50i-usb3.c
index b1c04f71a31d..84055b720016 100644
--- a/drivers/phy/allwinner/phy-sun50i-usb3.c
+++ b/drivers/phy/allwinner/phy-sun50i-usb3.c
@@ -134,7 +134,6 @@ static int sun50i_usb3_phy_probe(struct platform_device *pdev)
 	struct sun50i_usb3_phy *phy;
 	struct device *dev = &pdev->dev;
 	struct phy_provider *phy_provider;
-	struct resource *res;
 
 	phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
 	if (!phy)
@@ -153,8 +152,7 @@ static int sun50i_usb3_phy_probe(struct platform_device *pdev)
 		return PTR_ERR(phy->reset);
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	phy->regs = devm_ioremap_resource(dev, res);
+	phy->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(phy->regs))
 		return PTR_ERR(phy->regs);
 
diff --git a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
index 1fa761ba6cbb..f0bc87d654d4 100644
--- a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
+++ b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
@@ -253,15 +253,13 @@ static int sun6i_dphy_probe(struct platform_device *pdev)
 {
 	struct phy_provider *phy_provider;
 	struct sun6i_dphy *dphy;
-	struct resource *res;
 	void __iomem *regs;
 
 	dphy = devm_kzalloc(&pdev->dev, sizeof(*dphy), GFP_KERNEL);
 	if (!dphy)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	regs = devm_ioremap_resource(&pdev->dev, res);
+	regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(regs)) {
 		dev_err(&pdev->dev, "Couldn't map the DPHY encoder registers\n");
 		return PTR_ERR(regs);
diff --git a/drivers/phy/allwinner/phy-sun9i-usb.c b/drivers/phy/allwinner/phy-sun9i-usb.c
index fc6784dd7fa0..2f9e60c188b8 100644
--- a/drivers/phy/allwinner/phy-sun9i-usb.c
+++ b/drivers/phy/allwinner/phy-sun9i-usb.c
@@ -117,7 +117,6 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
 	struct phy_provider *phy_provider;
-	struct resource *res;
 
 	phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
 	if (!phy)
@@ -156,8 +155,7 @@ static int sun9i_usb_phy_probe(struct platform_device *pdev)
 		}
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	phy->pmu = devm_ioremap_resource(dev, res);
+	phy->pmu = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(phy->pmu))
 		return PTR_ERR(phy->pmu);
 
-- 
2.18.0
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2020-10-30  3:49 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29  2:54 [PATCH 01/17] phy: allwinner: convert to devm_platform_ioremap_resource(_byname) Chunfeng Yun
2020-10-29  2:54 ` [PATCH 02/17] phy: amlogic: convert to devm_platform_ioremap_resource Chunfeng Yun
2020-10-29  8:24   ` Remi Pommarel
2020-10-30  3:46     ` Chunfeng Yun
2020-10-29  2:54 ` [PATCH 03/17] phy: broadcom: convert to devm_platform_ioremap_resource(_byname) Chunfeng Yun
2020-10-30  3:49   ` Florian Fainelli
2020-10-29  2:54 ` [PATCH 04/17] phy: cadence: convert to devm_platform_ioremap_resource Chunfeng Yun
2020-10-29 10:50   ` Peter Chen
2020-10-29  2:54 ` [PATCH 05/17] phy: freescale: " Chunfeng Yun
2020-10-29 10:51   ` Peter Chen
2020-10-29  2:54 ` [PATCH 06/17] phy: lantiq: " Chunfeng Yun
2020-10-29  2:54 ` [PATCH 07/17] phy: marvell: " Chunfeng Yun
2020-10-29  2:54 ` [PATCH 08/17] phy: phy-xgene: " Chunfeng Yun
2020-10-29  2:54 ` [PATCH 09/17] phy: phy-mtk-ufs: " Chunfeng Yun
2020-10-29  2:54 ` [PATCH 10/17] phy: qualcomm: convert to devm_platform_ioremap_resource(_byname) Chunfeng Yun
2020-10-29  2:54 ` [PATCH 11/17] phy: phy-ralink-usb: convert to devm_platform_ioremap_resource Chunfeng Yun
2020-10-29  2:54 ` [PATCH 12/17] phy: renesas: " Chunfeng Yun
2020-10-29  2:54 ` [PATCH 13/17] phy: rockchip: " Chunfeng Yun
2020-10-29  2:54 ` [PATCH 14/17] phy: samsung: " Chunfeng Yun
2020-10-29 16:50   ` Krzysztof Kozlowski
2020-10-29  2:54 ` [PATCH 15/17] phy: phy-stm32-usbphyc: " Chunfeng Yun
2020-10-29 10:20   ` Amelie DELAUNAY
2020-10-29  2:54 ` [PATCH 16/17] phy: tegra: convert to devm_platform_ioremap_resource(_byname) Chunfeng Yun
2020-10-29  2:54 ` [PATCH 17/17] phy: ti: " Chunfeng Yun

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).