linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code
@ 2019-09-06 13:10 YueHaibing
  2019-09-06 17:16 ` Eugeniy Paltsev
  2019-09-11 13:50 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2019-09-06 13:10 UTC (permalink / raw)
  To: Eugeniy.Paltsev, linus.walleij, bgolaszewski
  Cc: linux-gpio, linux-kernel, kernel-janitors, YueHaibing

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/gpio/gpio-creg-snps.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-creg-snps.c b/drivers/gpio/gpio-creg-snps.c
index 8cbc94d..ff19a8a 100644
--- a/drivers/gpio/gpio-creg-snps.c
+++ b/drivers/gpio/gpio-creg-snps.c
@@ -137,7 +137,6 @@ static int creg_gpio_probe(struct platform_device *pdev)
 	const struct of_device_id *match;
 	struct device *dev = &pdev->dev;
 	struct creg_gpio *hcg;
-	struct resource *mem;
 	u32 ngpios;
 	int ret;
 
@@ -145,8 +144,7 @@ static int creg_gpio_probe(struct platform_device *pdev)
 	if (!hcg)
 		return -ENOMEM;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	hcg->regs = devm_ioremap_resource(dev, mem);
+	hcg->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(hcg->regs))
 		return PTR_ERR(hcg->regs);
 
-- 
2.7.4



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

* Re: [PATCH -next] gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code
  2019-09-06 13:10 [PATCH -next] gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code YueHaibing
@ 2019-09-06 17:16 ` Eugeniy Paltsev
  2019-09-11 13:50 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Eugeniy Paltsev @ 2019-09-06 17:16 UTC (permalink / raw)
  To: YueHaibing, linus.walleij, bgolaszewski
  Cc: linux-gpio, linux-kernel, kernel-janitors

Hi YueHaibing,

thanks,
Acked-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>

---
 Eugeniy Paltsev


________________________________________
From: YueHaibing <yuehaibing@huawei.com>
Sent: Friday, September 6, 2019 16:10
To: Eugeniy.Paltsev@synopsys.com; linus.walleij@linaro.org; bgolaszewski@baylibre.com
Cc: linux-gpio@vger.kernel.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; YueHaibing
Subject: [PATCH -next] gpio: creg-snps: 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@huawei.com>
---
 drivers/gpio/gpio-creg-snps.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-creg-snps.c b/drivers/gpio/gpio-creg-snps.c
index 8cbc94d..ff19a8a 100644
--- a/drivers/gpio/gpio-creg-snps.c
+++ b/drivers/gpio/gpio-creg-snps.c
@@ -137,7 +137,6 @@ static int creg_gpio_probe(struct platform_device *pdev)
        const struct of_device_id *match;
        struct device *dev = &pdev->dev;
        struct creg_gpio *hcg;
-       struct resource *mem;
        u32 ngpios;
        int ret;

@@ -145,8 +144,7 @@ static int creg_gpio_probe(struct platform_device *pdev)
        if (!hcg)
                return -ENOMEM;

-       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       hcg->regs = devm_ioremap_resource(dev, mem);
+       hcg->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(hcg->regs))
                return PTR_ERR(hcg->regs);

--
2.7.4



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

* Re: [PATCH -next] gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code
  2019-09-06 13:10 [PATCH -next] gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code YueHaibing
  2019-09-06 17:16 ` Eugeniy Paltsev
@ 2019-09-11 13:50 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2019-09-11 13:50 UTC (permalink / raw)
  To: YueHaibing
  Cc: Eugeniy.Paltsev, Bartosz Golaszewski, open list:GPIO SUBSYSTEM,
	linux-kernel, kernel-janitors

On Fri, Sep 6, 2019 at 2:48 PM YueHaibing <yuehaibing@huawei.com> wrote:

> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Patch applied with Eugeniy's ACK!

Yours,
Linus Walleij

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

end of thread, other threads:[~2019-09-11 13:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 13:10 [PATCH -next] gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-09-06 17:16 ` Eugeniy Paltsev
2019-09-11 13:50 ` Linus Walleij

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