[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191017122640.22976-13-yuehaibing@huawei.com>
Date: Thu, 17 Oct 2019 20:26:22 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: <linus.walleij@...aro.org>, <manivannan.sadhasivam@...aro.org>,
<afaerber@...e.de>, <f.fainelli@...il.com>, <rjui@...adcom.com>,
<sbranden@...adcom.com>, <bcm-kernel-feedback-list@...adcom.com>,
<jesper.nilsson@...s.com>, <lars.persson@...s.com>,
<ludovic.desroches@...rochip.com>, <nicolas.ferre@...rochip.com>,
<alexandre.belloni@...tlin.com>, <baruch@...s.co.il>
CC: <linux-arm-kernel@...ts.infradead.org>,
<linux-gpio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...s.com>, <linux-oxnas@...ups.io>,
<linux-renesas-soc@...r.kernel.org>,
<linux-arm-msm@...r.kernel.org>, <linux-tegra@...r.kernel.org>,
<vz@...ia.com>, <narmstrong@...libre.com>,
<geert+renesas@...der.be>, <daniel@...que.org>,
<haojian.zhuang@...il.com>, <wens@...e.org>,
<thierry.reding@...il.com>, <jonathanh@...dia.com>,
<agross@...nel.org>, YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH -next 12/30] pinctrl: spear: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
drivers/pinctrl/spear/pinctrl-plgpio.c | 4 +---
drivers/pinctrl/spear/pinctrl-spear.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
index c4c9a29..1ebbc49 100644
--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
@@ -515,15 +515,13 @@ static int plgpio_probe_dt(struct platform_device *pdev, struct plgpio *plgpio)
static int plgpio_probe(struct platform_device *pdev)
{
struct plgpio *plgpio;
- struct resource *res;
int ret, irq;
plgpio = devm_kzalloc(&pdev->dev, sizeof(*plgpio), GFP_KERNEL);
if (!plgpio)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- plgpio->base = devm_ioremap_resource(&pdev->dev, res);
+ plgpio->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(plgpio->base))
return PTR_ERR(plgpio->base);
diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c
index 7ec19c7..948f56a 100644
--- a/drivers/pinctrl/spear/pinctrl-spear.c
+++ b/drivers/pinctrl/spear/pinctrl-spear.c
@@ -358,7 +358,6 @@ int spear_pinctrl_probe(struct platform_device *pdev,
struct spear_pinctrl_machdata *machdata)
{
struct device_node *np = pdev->dev.of_node;
- struct resource *res;
struct spear_pmx *pmx;
if (!machdata)
@@ -368,8 +367,7 @@ int spear_pinctrl_probe(struct platform_device *pdev,
if (!pmx)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- pmx->vbase = devm_ioremap_resource(&pdev->dev, res);
+ pmx->vbase = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pmx->vbase))
return PTR_ERR(pmx->vbase);
--
2.7.4
Powered by blists - more mailing lists