From: YueHaibing <yuehaibing@huawei.com> 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 <yuehaibing@huawei.com> Subject: [PATCH -next] gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code Date: Fri, 6 Sep 2019 21:10:32 +0800 [thread overview] Message-ID: <20190906131032.22148-1-yuehaibing@huawei.com> (raw) 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
WARNING: multiple messages have this Message-ID (diff)
From: YueHaibing <yuehaibing@huawei.com> 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 <yuehaibing@huawei.com> Subject: [PATCH -next] gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code Date: Fri, 06 Sep 2019 13:10:32 +0000 [thread overview] Message-ID: <20190906131032.22148-1-yuehaibing@huawei.com> (raw) 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
next reply other threads:[~2019-09-06 13:48 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-06 13:10 YueHaibing [this message] 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-06 17:16 ` Eugeniy Paltsev 2019-09-11 13:50 ` Linus Walleij 2019-09-11 13:50 ` Linus Walleij
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=20190906131032.22148-1-yuehaibing@huawei.com \ --to=yuehaibing@huawei.com \ --cc=Eugeniy.Paltsev@synopsys.com \ --cc=bgolaszewski@baylibre.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linus.walleij@linaro.org \ --cc=linux-gpio@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ /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: linkBe 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.