diff mbox series

[20/42] drivers: gpio: mt7621: use devm_platform_ioremap_resource()

Message ID 1552330521-4276-20-git-send-email-info@metux.net (mailing list archive)
State Not Applicable
Headers show
Series [01/42] drivers: gpio: 74xx-mmio: use devm_platform_ioremap_resource() | expand

Commit Message

Enrico Weigelt, metux IT consult March 11, 2019, 6:54 p.m. UTC
Use the new helper that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/gpio/gpio-mt7621.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Matthias Brugger March 12, 2019, 11:14 a.m. UTC | #1
On 11/03/2019 19:54, Enrico Weigelt, metux IT consult wrote:
> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ---
>  drivers/gpio/gpio-mt7621.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> 
> diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
> index 74401e0..79654fb 100644
> --- a/drivers/gpio/gpio-mt7621.c
> +++ b/drivers/gpio/gpio-mt7621.c
> @@ -293,7 +293,6 @@ struct mtk {
>  static int
>  mediatek_gpio_probe(struct platform_device *pdev)
>  {
> -	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	struct device *dev = &pdev->dev;
>  	struct device_node *np = dev->of_node;
>  	struct mtk *mtk;
> @@ -304,7 +303,7 @@ struct mtk {
>  	if (!mtk)
>  		return -ENOMEM;
>  
> -	mtk->base = devm_ioremap_resource(dev, res);
> +	mtk->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(mtk->base))
>  		return PTR_ERR(mtk->base);
>  
>
Linus Walleij April 3, 2019, 2:59 a.m. UTC | #2
On Tue, Mar 12, 2019 at 1:59 AM Enrico Weigelt, metux IT consult
<info@metux.net> wrote:

> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
>
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

Patch applied with Matthias' ACK.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
index 74401e0..79654fb 100644
--- a/drivers/gpio/gpio-mt7621.c
+++ b/drivers/gpio/gpio-mt7621.c
@@ -293,7 +293,6 @@  struct mtk {
 static int
 mediatek_gpio_probe(struct platform_device *pdev)
 {
-	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
 	struct mtk *mtk;
@@ -304,7 +303,7 @@  struct mtk {
 	if (!mtk)
 		return -ENOMEM;
 
-	mtk->base = devm_ioremap_resource(dev, res);
+	mtk->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mtk->base))
 		return PTR_ERR(mtk->base);