From: Frank Lee <frank@allwinnertech.com>
To: vkoul@kernel.org, robh+dt@kernel.org, mripard@kernel.org,
wens@csie.org, ulf.hansson@linaro.org, kishon@ti.com,
wim@linux-watchdog.org, linux@roeck-us.net,
dan.j.williams@intel.com, linus.walleij@linaro.org,
wsa+renesas@sang-engineering.com, dianders@chromium.org,
marex@denx.de, colin.king@canonical.com, rdunlap@infradead.org,
krzk@kernel.org, gregkh@linuxfoundation.org, megous@megous.com,
rikard.falkeborn@gmail.com, dmaengine@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-watchdog@vger.kernel.org, linux-gpio@vger.kernel.org,
tiny.windzz@gmail.com
Cc: Yangtao Li <frank@allwinnertech.com>
Subject: [PATCH 09/19] phy: allwinner: Convert to devm_platform_ioremap_* API
Date: Tue, 10 Nov 2020 12:05:43 +0800 [thread overview]
Message-ID: <20201110040553.1381-10-frank@allwinnertech.com> (raw)
In-Reply-To: <20201110040553.1381-1-frank@allwinnertech.com>
From: Yangtao Li <frank@allwinnertech.com>
Use the devm_platform_ioremap_resource_byname() and
devm_platform_ioremap_resource helper to simplify the code.
Signed-off-by: Yangtao Li <frank@allwinnertech.com>
---
drivers/phy/allwinner/phy-sun4i-usb.c | 9 +++------
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, 6 insertions(+), 15 deletions(-)
diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
index 0f1888b55dbd..a6900495baa5 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,8 @@ 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.28.0
next prev parent reply other threads:[~2020-11-10 4:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 4:05 [PATCH 00/19] Second step support for A100 Frank Lee
2020-11-10 4:05 ` [PATCH 01/19] pinctrl: sunxi: fix irq bank map for the Allwinner A100 pin controller Frank Lee
2020-11-10 4:05 ` [PATCH 02/19] pinctrl: sunxi: Mark the irq bank not found in sunxi_pinctrl_irq_handler() with WARN_ON Frank Lee
2020-11-10 4:05 ` [PATCH 03/19] pinctrl: sunxi: Always call chained_irq_{enter, exit} in sunxi_pinctrl_irq_handler Frank Lee
2020-11-10 4:05 ` [PATCH 04/19] dt-bindings: dma: allwinner,sun50i-a64-dma: Add A100 compatible Frank Lee
2020-11-10 4:05 ` [PATCH 05/19] dmaengine: sun6i: Add support for A100 DMA Frank Lee
2020-11-10 4:05 ` [PATCH 06/19] arm64: allwinner: a100: Add device node for DMA controller Frank Lee
2020-11-10 4:05 ` [PATCH 07/19] arm64: dts: allwinner: A100: Add PMU mode Frank Lee
2020-11-10 4:05 ` [PATCH 08/19] phy: sun4i-usb: remove enable_pmu_unk1 from sun50i_h6_cfg Frank Lee
2020-11-10 4:05 ` Frank Lee [this message]
2020-11-10 6:00 ` [PATCH 00/19] Second step support for A100 Frank Lee
2020-11-10 8:43 ` Krzysztof Kozlowski
2020-11-10 8:51 ` Frank Lee
2020-11-10 12:48 ` Vinod Koul
2020-11-10 12:55 ` maxime
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=20201110040553.1381-10-frank@allwinnertech.com \
--to=frank@allwinnertech.com \
--cc=colin.king@canonical.com \
--cc=dan.j.williams@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dmaengine@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@ti.com \
--cc=krzk@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=marex@denx.de \
--cc=megous@megous.com \
--cc=mripard@kernel.org \
--cc=rdunlap@infradead.org \
--cc=rikard.falkeborn@gmail.com \
--cc=robh+dt@kernel.org \
--cc=tiny.windzz@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=vkoul@kernel.org \
--cc=wens@csie.org \
--cc=wim@linux-watchdog.org \
--cc=wsa+renesas@sang-engineering.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 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).