All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Kishon Vijay Abraham I <kishon@ti.com>, Vinod Koul <vkoul@kernel.org>
Cc: Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	<bcm-kernel-feedback-list@broadcom.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Lubomir Rintel <lkundrak@v3.sk>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Colin Ian King <colin.king@canonical.com>,
	Ondrej Jirman <megous@megous.com>,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Icenowy Zheng <icenowy@aosc.io>,
	Remi Pommarel <repk@triplefau.lt>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Yue Wang <yue.wang@amlogic.com>,
	Hanjie Lin <hanjie.lin@amlogic.com>,
	Joe Perches <joe@perches.com>,
	Bharat Gooty <bharat.gooty@broadcom.com>,
	Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
	Peter Chen <peter.chen@nxp.com>, Roger Quadros <rogerq@ti.com>,
	Jyri Sarha <jsarha@ti.com>, Sanket Parmar <sparmar@cadence.com>,
	Anil Varughese <aniljoy@cadence.com>, Li Jun <jun.li@nxp.com>,
	Ma Feng <mafeng.ma@huawei.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-amlogic@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>
Subject: [PATCH v2 01/17] phy: allwinner: convert to devm_platform_ioremap_resource(_byname)
Date: Fri, 6 Nov 2020 14:08:34 +0800	[thread overview]
Message-ID: <1604642930-29019-1-git-send-email-chunfeng.yun@mediatek.com> (raw)

Use devm_platform_ioremap_resource(_byname) to simplify code

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v2: no changes
---
 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

WARNING: multiple messages have this Message-ID (diff)
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Kishon Vijay Abraham I <kishon@ti.com>, Vinod Koul <vkoul@kernel.org>
Cc: Ondrej Jirman <megous@megous.com>,
	Peter Chen <peter.chen@nxp.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Anil Varughese <aniljoy@cadence.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Fabio Estevam <festevam@gmail.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
	Chen-Yu Tsai <wens@csie.org>,
	bcm-kernel-feedback-list@broadcom.com,
	NXP Linux Team <linux-imx@nxp.com>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Icenowy Zheng <icenowy@aosc.io>,
	Bharat Gooty <bharat.gooty@broadcom.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Ray Jui <rjui@broadcom.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Maxime Ripard <mripard@kernel.org>,
	Yue Wang <yue.wang@amlogic.com>, Lubomir Rintel <lkundrak@v3.sk>,
	Remi Pommarel <repk@triplefau.lt>,
	linux-mediatek@lists.infradead.org,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	Roger Quadros <rogerq@ti.com>,
	Hanjie Lin <hanjie.lin@amlogic.com>,
	Ma Feng <mafeng.ma@huawei.com>,
	Scott Branden <sbranden@broadcom.com>,
	Randy Dunlap <rdunlap@infradead.org>, Jyri Sarha <jsarha@ti.com>,
	linux-kernel@vger.kernel.org, Sanket Parmar <sparmar@cadence.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Joe Perches <joe@perches.com>,
	Colin Ian King <colin.king@canonical.com>,
	Shawn Guo <shawnguo@kernel.org>, Li Jun <jun.li@nxp.com>
Subject: [PATCH v2 01/17] phy: allwinner: convert to devm_platform_ioremap_resource(_byname)
Date: Fri, 6 Nov 2020 14:08:34 +0800	[thread overview]
Message-ID: <1604642930-29019-1-git-send-email-chunfeng.yun@mediatek.com> (raw)

Use devm_platform_ioremap_resource(_byname) to simplify code

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v2: no changes
---
 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-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Kishon Vijay Abraham I <kishon@ti.com>, Vinod Koul <vkoul@kernel.org>
Cc: Ondrej Jirman <megous@megous.com>,
	Peter Chen <peter.chen@nxp.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Anil Varughese <aniljoy@cadence.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Fabio Estevam <festevam@gmail.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
	Chen-Yu Tsai <wens@csie.org>,
	bcm-kernel-feedback-list@broadcom.com,
	NXP Linux Team <linux-imx@nxp.com>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Icenowy Zheng <icenowy@aosc.io>,
	Bharat Gooty <bharat.gooty@broadcom.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Ray Jui <rjui@broadcom.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Maxime Ripard <mripard@kernel.org>,
	Yue Wang <yue.wang@amlogic.com>, Lubomir Rintel <lkundrak@v3.sk>,
	Remi Pommarel <repk@triplefau.lt>,
	linux-mediatek@lists.infradead.org,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	Roger Quadros <rogerq@ti.com>,
	Hanjie Lin <hanjie.lin@amlogic.com>,
	Ma Feng <mafeng.ma@huawei.com>,
	Scott Branden <sbranden@broadcom.com>,
	Randy Dunlap <rdunlap@infradead.org>, Jyri Sarha <jsarha@ti.com>,
	linux-kernel@vger.kernel.org, Sanket Parmar <sparmar@cadence.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Joe Perches <joe@perches.com>,
	Colin Ian King <colin.king@canonical.com>,
	Shawn Guo <shawnguo@kernel.org>, Li Jun <jun.li@nxp.com>
Subject: [PATCH v2 01/17] phy: allwinner: convert to devm_platform_ioremap_resource(_byname)
Date: Fri, 6 Nov 2020 14:08:34 +0800	[thread overview]
Message-ID: <1604642930-29019-1-git-send-email-chunfeng.yun@mediatek.com> (raw)

Use devm_platform_ioremap_resource(_byname) to simplify code

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v2: no changes
---
 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-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Kishon Vijay Abraham I <kishon@ti.com>, Vinod Koul <vkoul@kernel.org>
Cc: Ondrej Jirman <megous@megous.com>,
	Peter Chen <peter.chen@nxp.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Anil Varughese <aniljoy@cadence.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Fabio Estevam <festevam@gmail.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
	Chen-Yu Tsai <wens@csie.org>,
	bcm-kernel-feedback-list@broadcom.com,
	NXP Linux Team <linux-imx@nxp.com>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Icenowy Zheng <icenowy@aosc.io>,
	Bharat Gooty <bharat.gooty@broadcom.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Ray Jui <rjui@broadcom.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Maxime Ripard <mripard@kernel.org>,
	Yue Wang <yue.wang@amlogic.com>, Lubomir Rintel <lkundrak@v3.sk>,
	Remi Pommarel <repk@triplefau.lt>,
	linux-mediatek@lists.infradead.org,
	Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	Roger Quadros <rogerq@ti.com>,
	Hanjie Lin <hanjie.lin@amlogic.com>,
	Ma Feng <mafeng.ma@huawei.com>,
	Scott Branden <sbranden@broadcom.com>,
	Randy Dunlap <rdunlap@infradead.org>, Jyri Sarha <jsarha@ti.com>,
	linux-kernel@vger.kernel.org, Sanket Parmar <sparmar@cadence.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Joe Perches <joe@perches.com>,
	Colin Ian King <colin.king@canonical.com>,
	Shawn Guo <shawnguo@kernel.org>, Li Jun <jun.li@nxp.com>
Subject: [PATCH v2 01/17] phy: allwinner: convert to devm_platform_ioremap_resource(_byname)
Date: Fri, 6 Nov 2020 14:08:34 +0800	[thread overview]
Message-ID: <1604642930-29019-1-git-send-email-chunfeng.yun@mediatek.com> (raw)

Use devm_platform_ioremap_resource(_byname) to simplify code

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v2: no changes
---
 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

             reply	other threads:[~2020-11-06  6:09 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06  6:08 Chunfeng Yun [this message]
2020-11-06  6:08 ` [PATCH v2 01/17] phy: allwinner: convert to devm_platform_ioremap_resource(_byname) Chunfeng Yun
2020-11-06  6:08 ` Chunfeng Yun
2020-11-06  6:08 ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 02/17] phy: amlogic: convert to devm_platform_ioremap_resource Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-08 22:11   ` Martin Blumenstingl
2020-11-08 22:11     ` Martin Blumenstingl
2020-11-08 22:11     ` Martin Blumenstingl
2020-11-06  6:08 ` [PATCH v2 03/17] phy: broadcom: convert to devm_platform_ioremap_resource(_byname) Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 04/17] phy: cadence: convert to devm_platform_ioremap_resource Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 05/17] phy: freescale: " Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 06/17] phy: lantiq: " Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-08 22:10   ` Martin Blumenstingl
2020-11-06  6:08 ` [PATCH v2 07/17] phy: marvell: " Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-09  2:04   ` Jisheng Zhang
2020-11-09  2:04     ` Jisheng Zhang
2020-11-09  2:04     ` Jisheng Zhang
2020-11-09  2:04     ` Jisheng Zhang
2020-11-06  6:08 ` [PATCH v2 08/17] phy: phy-xgene: " Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 09/17] phy: phy-mtk-ufs: " Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 10/17] phy: qualcomm: convert to devm_platform_ioremap_resource(_byname) Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 11/17] phy: phy-ralink-usb: convert to devm_platform_ioremap_resource Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 12/17] phy: renesas: " Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 13/17] phy: rockchip: " Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 14/17] phy: samsung: " Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 15/17] phy: phy-stm32-usbphyc: " Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 16/17] phy: tegra: convert to devm_platform_ioremap_resource(_byname) Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08 ` [PATCH v2 17/17] phy: ti: " Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-06  6:08   ` Chunfeng Yun
2020-11-16  7:19 ` [PATCH v2 01/17] phy: allwinner: " Vinod Koul
2020-11-16  7:19   ` Vinod Koul
2020-11-16  7:19   ` Vinod Koul
2020-11-16  7:19   ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1604642930-29019-1-git-send-email-chunfeng.yun@mediatek.com \
    --to=chunfeng.yun@mediatek.com \
    --cc=aniljoy@cadence.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bharat.gooty@broadcom.com \
    --cc=colin.king@canonical.com \
    --cc=f.fainelli@gmail.com \
    --cc=festevam@gmail.com \
    --cc=hanjie.lin@amlogic.com \
    --cc=icenowy@aosc.io \
    --cc=jbrunet@baylibre.com \
    --cc=joe@perches.com \
    --cc=jsarha@ti.com \
    --cc=jun.li@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=khilman@baylibre.com \
    --cc=kishon@ti.com \
    --cc=krzk@kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lkundrak@v3.sk \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mafeng.ma@huawei.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=megous@megous.com \
    --cc=mripard@kernel.org \
    --cc=narmstrong@baylibre.com \
    --cc=peter.chen@nxp.com \
    --cc=rayagonda.kokatanur@broadcom.com \
    --cc=rdunlap@infradead.org \
    --cc=repk@triplefau.lt \
    --cc=rikard.falkeborn@gmail.com \
    --cc=rjui@broadcom.com \
    --cc=rogerq@ti.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sbranden@broadcom.com \
    --cc=shawnguo@kernel.org \
    --cc=sparmar@cadence.com \
    --cc=vkoul@kernel.org \
    --cc=weiyongjun1@huawei.com \
    --cc=wens@csie.org \
    --cc=yue.wang@amlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.