drivers: gpio: 74xx-mmio: use devm_platform_ioremap_resource()
Subsystems (19)
PATCH 1/42 drivers: gpio: 74xx-mmio: use devm_platform_ioremap_resource()
Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-74xx-mmio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-74xx-mmio.c +1 -3
@@ -106,7 +106,6 @@ static int mmio_74xx_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)static int mmio_74xx_gpio_probe (struct platform_device *pdev) {struct mmio_74xx_gpio_priv *priv; -struct resource *res;void __iomem *dat;int err;
@@ -116,8 +115,7 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev) priv->flags = (uintptr_t )of_device_get_match_data (&pdev->dev); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - dat =devm_ioremap_resource (&pdev->dev, res); + dat =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (dat))return PTR_ERR (dat);
Signature · 1 line
1.9.1
PATCH 2/42 drivers: gpio: amdpt: use devm_platform_ioremap_resource()
Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-amdpt.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/gpio/gpio-amdpt.c +1 -7
@@ -78,7 +78,6 @@ static int pt_gpio_probe(struct platform_device *pdev)struct acpi_device *acpi_dev;acpi_handle handle =ACPI_HANDLE (dev);struct pt_gpio_chip *pt_gpio; -struct resource *res_mem;int ret =0 ;if (acpi_bus_get_device (handle, &acpi_dev)) {
@@ -90,12 +89,7 @@ static int pt_gpio_probe(struct platform_device *pdev)if (!pt_gpio)return -ENOMEM ; - res_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res_mem) { -dev_err (&pdev->dev,"Failed to get MMIO resource for PT GPIO.\n" ); -return -EINVAL ; - } - pt_gpio->reg_base =devm_ioremap_resource (dev, res_mem); + pt_gpio->reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (pt_gpio->reg_base)) {dev_err (&pdev->dev,"Failed to map MMIO resource for PT GPIO.\n" );return PTR_ERR (pt_gpio->reg_base);
Signature · 1 line
1.9.1
Re: [PATCH 02/42] drivers: gpio: amdpt: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 3/42 drivers: gpio: amdpt: drop unneeded deref of &pdev->dev
In reply to Enrico Weigelt, metux IT consultWe already have the struct device* pointer in a local variable, so we can write this a bit shorter.
--- drivers/gpio/gpio-amdpt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpio/gpio-amdpt.c +5 -5
@@ -91,7 +91,7 @@ static int pt_gpio_probe(struct platform_device *pdev) pt_gpio->reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (pt_gpio->reg_base)) { -dev_err (&pdev->dev,"Failed to map MMIO resource for PT GPIO.\n" ); +dev_err (dev,"Failed to map MMIO resource for PT GPIO.\n" );return PTR_ERR (pt_gpio->reg_base); }
@@ -101,7 +101,7 @@ static int pt_gpio_probe(struct platform_device *pdev) pt_gpio->reg_base +PT_DIRECTION_REG ,NULL , BGPIOF_READ_OUTPUT_REG_SET);if (ret) { -dev_err (&pdev->dev,"bgpio_init failed\n" ); +dev_err (dev,"bgpio_init failed\n" );return ret; }
@@ -110,11 +110,11 @@ static int pt_gpio_probe(struct platform_device *pdev) pt_gpio->gc.free = pt_gpio_free; pt_gpio->gc.ngpio =PT_TOTAL_GPIO ;#if defined(CONFIG_OF_GPIO ) - pt_gpio->gc.of_node = pdev->dev.of_node; + pt_gpio->gc.of_node = dev.of_node;#endif ret =gpiochip_add_data (&pt_gpio->gc, pt_gpio);if (ret) { -dev_err (&pdev->dev,"Failed to register GPIO lib\n" ); +dev_err (dev,"Failed to register GPIO lib\n" );return ret; }
@@ -124,7 +124,7 @@ static int pt_gpio_probe(struct platform_device *pdev)writel (0 , pt_gpio->reg_base +PT_SYNC_REG );writel (0 , pt_gpio->reg_base +PT_CLOCKRATE_REG ); -dev_dbg (&pdev->dev,"PT GPIO driver loaded\n" ); +dev_dbg (dev,"PT GPIO driver loaded\n" );return ret; }
Signature · 1 line
1.9.1
Re: [PATCH 03/42] drivers: gpio: amdpt: drop unneeded deref of &pdev->dev
Quoted 31 lines · metux IT consult
We already have the struct device* pointer in a local variable, so we can write this a bit shorter.
Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-amdpt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/gpio/gpio-amdpt.c +2
-2@@ -91,7 +91,7 @@ static int pt_gpio_probe(struct platform_device *pdev) pt_gpio->reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (pt_gpio->reg_base)) { -dev_err (&pdev->dev,"Failed to map MMIO resource for PT GPIO.\n" ); +dev_err (dev,"Failed to map MMIO resource for PT GPIO.\n" );return PTR_ERR (pt_gpio->reg_base); }@@ -101,7 +101,7 @@ static int pt_gpio_probe(struct platform_device *pdev) pt_gpio->reg_base +PT_DIRECTION_REG ,NULL , BGPIOF_READ_OUTPUT_REG_SET);if (ret) { -dev_err (&pdev->dev,"bgpio_init failed\n" ); +dev_err (dev,"bgpio_init failed\n" );return ret; }
drivers/gpio/gpio-amdpt.c static int pt_gpio_probe(struct platform_device *pdev) · line 113
Quoted 5 lines
drivers/gpio/gpio-amdpt.c +1
-1@@ -110,11 +110,11 @@ static int pt_gpio_probe(struct platform_device *pdev) pt_gpio->gc.free = pt_gpio_free; pt_gpio->gc.ngpio =PT_TOTAL_GPIO ;#if defined(CONFIG_OF_GPIO ) - pt_gpio->gc.of_node = pdev->dev.of_node; + pt_gpio->gc.of_node = dev.of_node;
"dev->of_node"?
Thierry
Re: [PATCH 03/42] drivers: gpio: amdpt: drop unneeded deref of &pdev->dev
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
We already have the struct device* pointer in a local variable, so we can write this a bit shorter.
Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Thierry seems to have spotted a bug in this patch so please resend it fixed (I will apply some others though so no need to resend all).
Yours,
Linus Walleij
PATCH 4/42 drivers: gpio: aspeed: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-aspeed.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-aspeed.c +1 -3
@@ -1156,15 +1156,13 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev) {const struct of_device_id *gpio_id;struct aspeed_gpio *gpio; -struct resource *res;int rc, i, banks; gpio =devm_kzalloc (&pdev->dev,sizeof (*gpio),GFP_KERNEL );if (!gpio)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - gpio->base =devm_ioremap_resource (&pdev->dev, res); + gpio->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (gpio->base))return PTR_ERR (gpio->base);
Signature · 1 line
1.9.1
Re: [PATCH 04/42] drivers: gpio: aspeed: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 5/42 drivers: gpio: bcm-kona: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-bcm-kona.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-bcm-kona.c +1 -3
@@ -568,7 +568,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;const struct of_device_id *match; -struct resource *res;struct bcm_kona_gpio_bank *bank;struct bcm_kona_gpio *kona_gpio;struct gpio_chip *chip;
@@ -618,8 +617,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)return -ENXIO ; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - kona_gpio->reg_base =devm_ioremap_resource (dev, res); + kona_gpio->reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (kona_gpio->reg_base)) { ret = -ENXIO ; goto err_irq_domain;
Signature · 1 line
1.9.1
Re: [PATCH 05/42] drivers: gpio: bcm-kona: use devm_platform_ioremap_resource()
Quoted 21 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-bcm-kona.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpio/gpio-bcm-kona.c +0
-1@@ -568,7 +568,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;const struct of_device_id *match; -struct resource *res;struct bcm_kona_gpio_bank *bank;struct bcm_kona_gpio *kona_gpio;struct gpio_chip *chip;
drivers/gpio/gpio-bcm-kona.c static int bcm_kona_gpio_probe(struct platform_device *pdev) · line 620
Quoted 6 lines
drivers/gpio/gpio-bcm-kona.c +1
-2@@ -618,8 +617,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)return -ENXIO ; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - kona_gpio->reg_base =devm_ioremap_resource (dev, res); + kona_gpio->reg_base =devm_platform_ioremap_resource (pdev,0 );
Signature · 1 line
Florian
Re: [PATCH 05/42] drivers: gpio: bcm-kona: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 21 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-bcm-kona.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpio/gpio-bcm-kona.c +0
-1@@ -568,7 +568,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;const struct of_device_id *match; -struct resource *res;struct bcm_kona_gpio_bank *bank;struct bcm_kona_gpio *kona_gpio;struct gpio_chip *chip;
drivers/gpio/gpio-bcm-kona.c static int bcm_kona_gpio_probe(struct platform_device *pdev) · line 622
Quoted 8 lines
drivers/gpio/gpio-bcm-kona.c +1
-2@@ -618,8 +617,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)return -ENXIO ; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - kona_gpio->reg_base =devm_ioremap_resource (dev, res); + kona_gpio->reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (kona_gpio->reg_base)) { ret = -ENXIO ;
This should be
ret = PTR_ERR(kona_gpio->reg_base)
, shouldn't it? (If yes, this is orthogonal to this patch, but still worth fixing.)
@Julia: Is this something that coccinelle could catch?
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |
Re: [PATCH 05/42] drivers: gpio: bcm-kona: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied with Florian's ACK.
Yours,
Linus Walleij
PATCH 6/42 drivers: gpio: cadence: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-cadence.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-cadence.c +1 -3
@@ -148,7 +148,6 @@ static void cdns_gpio_irq_handler(struct irq_desc *desc)static int cdns_gpio_probe (struct platform_device *pdev) {struct cdns_gpio_chip *cgpio; -struct resource *res;int ret, irq;u32 dir_prev;u32 num_gpios =32 ;
@@ -157,8 +156,7 @@ static int cdns_gpio_probe(struct platform_device *pdev)if (!cgpio)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - cgpio->regs =devm_ioremap_resource (&pdev->dev, res); + cgpio->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (cgpio->regs))return PTR_ERR (cgpio->regs);
Signature · 1 line
1.9.1
Re: [PATCH 06/42] drivers: gpio: cadence: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 7/42 drivers: gpio: clps711x: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-clps711x.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpio/gpio-clps711x.c +2 -5
@@ -19,7 +19,6 @@ static int clps711x_gpio_probe(struct platform_device *pdev)struct device_node *np = pdev->dev.of_node;void __iomem *dat, *dir;struct gpio_chip *gc; -struct resource *res;int err, id;if (!np)
@@ -33,13 +32,11 @@ static int clps711x_gpio_probe(struct platform_device *pdev)if (!gc)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - dat =devm_ioremap_resource (&pdev->dev, res); + dat =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (dat))return PTR_ERR (dat); - res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); - dir =devm_ioremap_resource (&pdev->dev, res); + dir =devm_platform_ioremap_resource (pdev,1 );if (IS_ERR (dir))return PTR_ERR (dir);
Signature · 1 line
1.9.1
Re: [PATCH 07/42] drivers: gpio: clps711x: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 8/42 drivers: gpio: dwap: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-dwapb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-dwapb.c +1 -3
@@ -655,7 +655,6 @@ static void dwapb_gpio_unregister(struct dwapb_gpio *gpio)static int dwapb_gpio_probe (struct platform_device *pdev) {unsigned int i; -struct resource *res;struct dwapb_gpio *gpio;int err;struct device *dev = &pdev->dev;
@@ -688,8 +687,7 @@ static int dwapb_gpio_probe(struct platform_device *pdev)if (!gpio->ports)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - gpio->regs =devm_ioremap_resource (&pdev->dev, res); + gpio->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (gpio->regs))return PTR_ERR (gpio->regs);
Signature · 1 line
1.9.1
Re: [PATCH 08/42] drivers: gpio: dwap: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 9/42 drivers: gpio: sprd: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-eic-sprd.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/gpio/gpio-eic-sprd.c +2 -7
@@ -567,7 +567,6 @@ static int sprd_eic_probe(struct platform_device *pdev)const struct sprd_eic_variant_data *pdata;struct gpio_irq_chip *irq;struct sprd_eic *sprd_eic; -struct resource *res;int ret, i; pdata =of_device_get_match_data (&pdev->dev);
@@ -596,13 +595,9 @@ static int sprd_eic_probe(struct platform_device *pdev)* have one bank EIC, thus base[1] and base[2] can be * optional. */ - res =platform_get_resource (pdev,IORESOURCE_MEM , i); -if (!res) -continue ; - - sprd_eic->base[i] =devm_ioremap_resource (&pdev->dev, res); + sprd_eic->base[i] =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (sprd_eic->base[i])) -return PTR_ERR (sprd_eic->base[i]); +continue ; } sprd_eic->chip.label = sprd_eic_label_name[sprd_eic->type];
Signature · 1 line
1.9.1
Re: [PATCH 09/42] drivers: gpio: sprd: use devm_platform_ioremap_resource()
Quoted 22 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-eic-sprd.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/gpio/gpio-eic-sprd.c +0
-1@@ -567,7 +567,6 @@ static int sprd_eic_probe(struct platform_device *pdev)const struct sprd_eic_variant_data *pdata;struct gpio_irq_chip *irq;struct sprd_eic *sprd_eic; -struct resource *res;int ret, i; pdata =of_device_get_match_data (&pdev->dev);
drivers/gpio/gpio-eic-sprd.c static int sprd_eic_probe(struct platform_device *pdev) · line 598
Quoted 9 lines
drivers/gpio/gpio-eic-sprd.c +1
-5@@ -596,13 +595,9 @@ static int sprd_eic_probe(struct platform_device *pdev)* have one bank EIC, thus base[1] and base[2] can be * optional. */ - res =platform_get_resource (pdev,IORESOURCE_MEM , i); -if (!res) -continue ; - - sprd_eic->base[i] =devm_ioremap_resource (&pdev->dev, res); + sprd_eic->base[i] =devm_platform_ioremap_resource (pdev,0 );
This is incorrect, since we can have multiple IO resources, but you only get index 0.
Quoted 9 lines
drivers/gpio/gpio-eic-sprd.c +1
-2if (IS_ERR (sprd_eic->base[i])) -return PTR_ERR (sprd_eic->base[i]); +continue ; } sprd_eic->chip.label = sprd_eic_label_name[sprd_eic->type]; --1.9.1
Signature · 2 lines
Baolin Wang Best Regards
Re: [PATCH 09/42] drivers: gpio: sprd: use devm_platform_ioremap_resource()
Quoted 22 lines · Baolin Wang
Quoted 20 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-eic-sprd.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/gpio/gpio-eic-sprd.c +0
-1@@ -567,7 +567,6 @@ static int sprd_eic_probe(struct platform_device *pdev)const struct sprd_eic_variant_data *pdata;struct gpio_irq_chip *irq;struct sprd_eic *sprd_eic; -struct resource *res;int ret, i;
Quoted 14 lines
drivers/gpio/gpio-eic-sprd.c static int sprd_eic_probe(struct platform_device *pdev) · line 598
Quoted 11 lines
drivers/gpio/gpio-eic-sprd.c +1
-5pdata =of_device_get_match_data (&pdev->dev);@@ -596,13 +595,9 @@ static int sprd_eic_probe(struct platform_device *pdev)* have one bank EIC, thus base[1] and base[2] can be * optional. */ - res =platform_get_resource (pdev,IORESOURCE_MEM , i); -if (!res) -continue ; - - sprd_eic->base[i] =devm_ioremap_resource (&pdev->dev, res); + sprd_eic->base[i] =devm_platform_ioremap_resource (pdev,0 );This is incorrect, since we can have multiple IO resources, but you only get index 0.
ah, right, it has to be i instead of 0. thanks for pointing that out.
--mtx
Signature · 3 lines
Enrico Weigelt, metux IT consult Free software and Linux embedded engineering [email protected] -- +49-151-27565287
Re: [PATCH 09/42] drivers: gpio: sprd: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 6 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-eic-sprd.c | 9 ++-------
Please fix the subject of this patch to gpio: eic-sprd: because gmail goes bananas with things that have the same subject line.
Yours,
Linus Walleij
PATCH 10/42 drivers: gpio: ep93xx: devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-ep93xx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpio/gpio-ep93xx.c +2 -5
@@ -393,16 +393,13 @@ static int ep93xx_gpio_add_bank(struct gpio_chip *gc, struct device *dev,static int ep93xx_gpio_probe (struct platform_device *pdev) {struct ep93xx_gpio *epg; -struct resource *res;int i; -struct device *dev = &pdev->dev; - epg =devm_kzalloc (dev,sizeof (*epg),GFP_KERNEL ); + epg =devm_kzalloc (&odev->dev,sizeof (*epg),GFP_KERNEL );if (!epg)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - epg->base =devm_ioremap_resource (dev, res); + epg->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (epg->base))return PTR_ERR (epg->base);
Signature · 1 line
1.9.1
Re: [PATCH 10/42] drivers: gpio: ep93xx: devm_platform_ioremap_resource()
Quoted 13 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-ep93xx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)drivers/gpio/gpio-ep93xx.c +0
-0
drivers/gpio/gpio-ep93xx.c static int ep93xx_gpio_add_bank(struct gpio_chip *gc, struct device *dev, · line 398
Quoted 9 lines
drivers/gpio/gpio-ep93xx.c +1
-3@@ -393,16 +393,13 @@ static int ep93xx_gpio_add_bank(struct gpio_chip *gc, struct device *dev,static int ep93xx_gpio_probe (struct platform_device *pdev) {struct ep93xx_gpio *epg; -struct resource *res;int i; -struct device *dev = &pdev->dev; - epg =devm_kzalloc (dev,sizeof (*epg),GFP_KERNEL ); + epg =devm_kzalloc (&odev->dev,sizeof (*epg),GFP_KERNEL );
odev -> pdev
You should write some scripts to compile-test these changes. Compilers are good at catching these silly typos. Humans not so much.
Thierry
Re: [PATCH 10/42] drivers: gpio: ep93xx: devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Skipping this patch for now because of the bug pointed out by Thierry, BTW rebase on my GPIO "devel" branch after I applied the uncontroversial patches (most of them are obviously correct).
I know it is not super easy to build all of those systems so cold coding is fine with me, I will find any remaining bugs for sure. :D
Yours,
Linus Walleij
PATCH 11/42 drivers: gpio: ftgpio010: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-ftgpio010.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-ftgpio010.c +1 -3
@@ -225,7 +225,6 @@ static int ftgpio_gpio_set_config(struct gpio_chip *gc, unsigned int offset,static int ftgpio_gpio_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct resource *res;struct ftgpio_gpio *g;int irq;int ret;
@@ -236,8 +235,7 @@ static int ftgpio_gpio_probe(struct platform_device *pdev) g->dev = dev; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - g->base =devm_ioremap_resource (dev, res); + g->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (g->base))return PTR_ERR (g->base);
Signature · 1 line
1.9.1
Re: [PATCH 11/42] drivers: gpio: ftgpio010: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 12/42 drivers: gpio: grgpio: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-grgpio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-grgpio.c +1 -3
@@ -333,7 +333,6 @@ static int grgpio_probe(struct platform_device *ofdev)void __iomem *regs;struct gpio_chip *gc;struct grgpio_priv *priv; -struct resource *res;int err;u32 prop;s32 *irqmap;
@@ -344,8 +343,7 @@ static int grgpio_probe(struct platform_device *ofdev)if (!priv)return -ENOMEM ; - res =platform_get_resource (ofdev,IORESOURCE_MEM ,0 ); - regs =devm_ioremap_resource (&ofdev->dev, res); + regs =devm_platform_ioremap_resource (&ofdev,0 );if (IS_ERR (regs))return PTR_ERR (regs);
Signature · 1 line
1.9.1
Re: [PATCH 12/42] drivers: gpio: grgpio: use devm_platform_ioremap_resource()
Quoted 21 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-grgpio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpio/gpio-grgpio.c +0
-1@@ -333,7 +333,6 @@ static int grgpio_probe(struct platform_device *ofdev)void __iomem *regs;struct gpio_chip *gc;struct grgpio_priv *priv; -struct resource *res;int err;u32 prop;s32 *irqmap;
drivers/gpio/gpio-grgpio.c static int grgpio_probe(struct platform_device *ofdev) · line 346
Quoted 6 lines
drivers/gpio/gpio-grgpio.c +1
-2@@ -344,8 +343,7 @@ static int grgpio_probe(struct platform_device *ofdev)if (!priv)return -ENOMEM ; - res =platform_get_resource (ofdev,IORESOURCE_MEM ,0 ); - regs =devm_ioremap_resource (&ofdev->dev, res); + regs =devm_platform_ioremap_resource (&ofdev,0 );
Drop the &?
Thierry
Re: [PATCH 12/42] drivers: gpio: grgpio: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Holding this one back so you can fix the bug pointed out by Thierry.
Yours,
Linus Walleij
PATCH 13/42 drivers: gpio: hlwd: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-hlwd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-hlwd.c +1 -3
@@ -208,7 +208,6 @@ static int hlwd_gpio_irq_set_type(struct irq_data *data, unsigned int flow_type)static int hlwd_gpio_probe (struct platform_device *pdev) {struct hlwd_gpio *hlwd; -struct resource *regs_resource;u32 ngpios;int res;
@@ -216,8 +215,7 @@ static int hlwd_gpio_probe(struct platform_device *pdev)if (!hlwd)return -ENOMEM ; - regs_resource =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - hlwd->regs =devm_ioremap_resource (&pdev->dev, regs_resource); + hlwd->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (hlwd->regs))return PTR_ERR (hlwd->regs);
Signature · 1 line
1.9.1
Re: [PATCH 13/42] drivers: gpio: hlwd: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Yours,
Linus Walleij
PATCH 14/42 drivers: gpio: iop: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-iop.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-iop.c +1 -3
@@ -21,7 +21,6 @@static int iop3xx_gpio_probe (struct platform_device *pdev) { -struct resource *res;struct gpio_chip *gc;void __iomem *base;int err;
@@ -30,8 +29,7 @@ static int iop3xx_gpio_probe(struct platform_device *pdev)if (!gc)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base))return PTR_ERR (base);
Signature · 1 line
1.9.1
Re: [PATCH 14/42] drivers: gpio: iop: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 15/42 drivers: gpio: janz-ttl: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-janz-ttl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-janz-ttl.c +1 -3
@@ -147,7 +147,6 @@ static int ttl_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct ttl_module *mod;struct gpio_chip *gpio; -struct resource *res;int ret; pdata =dev_get_platdata (&pdev->dev);
@@ -164,8 +163,7 @@ static int ttl_probe(struct platform_device *pdev)spin_lock_init (&mod->lock);/* get access to the MODULbus registers for this module */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - mod->regs =devm_ioremap_resource (dev, res); + mod->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mod->regs))return PTR_ERR (mod->regs);
Signature · 1 line
1.9.1
Re: [PATCH 15/42] drivers: gpio: janz-ttl: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 16/42 drivers: gpio: janz-ttl: drop unneccessary temp variable dev
In reply to Enrico Weigelt, metux IT consultdon't need the temporary variable "dev", directly use &pdev->dev
--- drivers/gpio/gpio-janz-ttl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpio/gpio-janz-ttl.c +4 -5
@@ -144,18 +144,17 @@ static void ttl_setup_device(struct ttl_module *mod)static int ttl_probe (struct platform_device *pdev) {struct janz_platform_data *pdata; -struct device *dev = &pdev->dev;struct ttl_module *mod;struct gpio_chip *gpio;int ret; pdata =dev_get_platdata (&pdev->dev);if (!pdata) { -dev_err (dev,"no platform data\n" ); +dev_err (&pdev->dev,"no platform data\n" );return -ENXIO ; } - mod =devm_kzalloc (dev,sizeof (*mod),GFP_KERNEL ); + mod =devm_kzalloc (&pdev->dev,sizeof (*mod),GFP_KERNEL );if (!mod)return -ENOMEM ;
@@ -181,9 +180,9 @@ static int ttl_probe(struct platform_device *pdev) gpio->base =-1 ; gpio->ngpio =20 ; - ret =devm_gpiochip_add_data (dev, gpio,NULL ); + ret =devm_gpiochip_add_data (&pdev->dev, gpio,NULL );if (ret) { -dev_err (dev,"unable to add GPIO chip\n" ); +dev_err (&pdev->dev,"unable to add GPIO chip\n" );return ret; }
Signature · 1 line
1.9.1
Re: [PATCH 16/42] drivers: gpio: janz-ttl: drop unneccessary temp variable dev
Quoted 3 lines · metux IT consult
don't need the temporary variable "dev", directly use
&pdev->devSigned-off-by Enrico Weigelt, metux IT consult <[email protected]>
This is quite usual to do, and I like it as it saves typing. Personally I would say don't bother with this change.
Quoted 42 lines
--- drivers/gpio/gpio-janz-ttl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)drivers/gpio/gpio-janz-ttl.c +4
-5@@ -144,18 +144,17 @@ static void ttl_setup_device(struct ttl_module *mod)static int ttl_probe (struct platform_device *pdev) {struct janz_platform_data *pdata; -struct device *dev = &pdev->dev;struct ttl_module *mod;struct gpio_chip *gpio;int ret; pdata =dev_get_platdata (&pdev->dev);if (!pdata) { -dev_err (dev,"no platform data\n" ); +dev_err (&pdev->dev,"no platform data\n" );return -ENXIO ; } - mod =devm_kzalloc (dev,sizeof (*mod),GFP_KERNEL ); + mod =devm_kzalloc (&pdev->dev,sizeof (*mod),GFP_KERNEL );if (!mod)return -ENOMEM ;@@ -181,9 +180,9 @@ static int ttl_probe(struct platform_device *pdev) gpio->base =-1 ; gpio->ngpio =20 ; - ret =devm_gpiochip_add_data (dev, gpio,NULL ); + ret =devm_gpiochip_add_data (&pdev->dev, gpio,NULL );if (ret) { -dev_err (dev,"unable to add GPIO chip\n" ); +dev_err (&pdev->dev,"unable to add GPIO chip\n" );return ret; }
Signature · 4 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html
Re: [PATCH 16/42] drivers: gpio: janz-ttl: drop unneccessary temp variable dev
Quoted 7 lines · Ben Dooks
Quoted 3 lines · metux IT consult
don't need the temporary variable "dev", directly use
&pdev->devSigned-off-by Enrico Weigelt, metux IT consult <[email protected]>This is quite usual to do, and I like it as it saves typing. Personally I would say don't bother with this change.
hmm, both approaches have their valid arguments.
I'm not particularily biased to one or another ay, but I'd prefer having it consistent everywhere.
--mtx
Signature · 3 lines
Enrico Weigelt, metux IT consult Free software and Linux embedded engineering [email protected] -- +49-151-27565287
Re: [PATCH 16/42] drivers: gpio: janz-ttl: drop unneccessary temp variable dev
Quoted 6 lines · metux IT consult
Quoted 5 lines · Ben Dooks
Quoted 3 lines · metux IT consult
don't need the temporary variable "dev", directly use
&pdev->devSigned-off-by Enrico Weigelt, metux IT consult <[email protected]>
Quoted 7 lines
Quoted 2 lines
This is quite usual to do, and I like it as it saves typing. Personally I would say don't bother with this change.
hmm, both approaches have their valid arguments.
I'm not particularily biased to one or another ay, but I'd prefer having it consistent everywhere.
You're not consistent within the series itself. In patch 3 you went the other way and dropped usage of pdev->dev in favour of the local dev variable.
Thierry
Re: [PATCH 16/42] drivers: gpio: janz-ttl: drop unneccessary temp variable dev
Quoted 3 lines · Thierry Reding
You're not consistent within the series itself. In patch 3 you went the other way and dropped usage of
pdev->devin favour of the local dev variable.
ups, you got me :O
Signature · 3 lines
Enrico Weigelt, metux IT consult Free software and Linux embedded engineering [email protected] -- +49-151-27565287
Re: [PATCH 16/42] drivers: gpio: janz-ttl: drop unneccessary temp variable dev
In reply to Enrico Weigelt, metux IT consultQuoted 3 lines · metux IT consult
don't need the temporary variable "dev", directly use
&pdev->devSigned-off-by Enrico Weigelt, metux IT consult <[email protected]>
Dropping this patch following the discussion. I like it better as it is :D
Yours,
Linus Walleij
PATCH 17/42 drivers: gpio: loongon1: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-loongson1.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-loongson1.c +1 -3
@@ -47,15 +47,13 @@ static int ls1x_gpio_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct gpio_chip *gc; -struct resource *res;int ret; gc =devm_kzalloc (dev,sizeof (*gc),GFP_KERNEL );if (!gc)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - gpio_reg_base =devm_ioremap_resource (dev, res); + gpio_reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (gpio_reg_base))return PTR_ERR (gpio_reg_base);
Signature · 1 line
1.9.1
Re: [PATCH 17/42] drivers: gpio: loongon1: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 18/42 drivers: gpio: lpc18xx: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-lpc18xx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpio/gpio-lpc18xx.c +1 -4
@@ -340,10 +340,7 @@ static int lpc18xx_gpio_probe(struct platform_device *pdev) index =of_property_match_string (dev->of_node,"reg-names" ,"gpio" );if (index <0 ) {/* To support backward compatibility take the first resource */ -struct resource *res; - - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - gc->base =devm_ioremap_resource (dev, res); + gc->base =devm_platform_ioremap_resource (pdev,0 ); }else {struct resource res;
Signature · 1 line
1.9.1
Re: [PATCH 18/42] drivers: gpio: lpc18xx: use devm_platform_ioremap_resource()
Quoted 15 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-lpc18xx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/gpio/gpio-lpc18xx.c +0
-0@@ -340,10 +340,7 @@ static int lpc18xx_gpio_probe(struct platform_device *pdev) index =of_property_match_string (dev->of_node,"reg-names" ,"gpio" );
drivers/gpio/gpio-lpc18xx.c static int lpc18xx_gpio_probe(struct platform_device *pdev) · line 346
Quoted 10 lines
drivers/gpio/gpio-lpc18xx.c +1
-4if (index <0 ) {/* To support backward compatibility take the first resource */ -struct resource *res; - - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - gc->base =devm_ioremap_resource (dev, res); + gc->base =devm_platform_ioremap_resource (pdev,0 ); }else {struct resource res;
--
Best wishes,
Vladimir
Re: [PATCH 18/42] drivers: gpio: lpc18xx: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 19/42 drivers: gpio: mb86s7x: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-mb86s7x.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-mb86s7x.c +1 -3
@@ -146,7 +146,6 @@ static void mb86s70_gpio_set(struct gpio_chip *gc, unsigned gpio, int value)static int mb86s70_gpio_probe (struct platform_device *pdev) {struct mb86s70_gpio_chip *gchip; -struct resource *res;int ret; gchip =devm_kzalloc (&pdev->dev,sizeof (*gchip),GFP_KERNEL );
@@ -155,8 +154,7 @@ static int mb86s70_gpio_probe(struct platform_device *pdev)platform_set_drvdata (pdev, gchip); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - gchip->base =devm_ioremap_resource (&pdev->dev, res); + gchip->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (gchip->base))return PTR_ERR (gchip->base);
Signature · 1 line
1.9.1
Re: [PATCH 19/42] drivers: gpio: mb86s7x: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 20/42 drivers: gpio: mt7621: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-mt7621.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpio/gpio-mt7621.c +1 -2
@@ -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);
Signature · 1 line
1.9.1
Re: [PATCH 20/42] drivers: gpio: mt7621: use devm_platform_ioremap_resource()
Quoted 7 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-mt7621.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 23 lines
drivers/gpio/gpio-mt7621.c +1
-2@@ -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);
Re: [PATCH 20/42] drivers: gpio: mt7621: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied with Matthias' ACK.
Yours,
Linus Walleij
PATCH 21/42 drivers: gpio: mvebu: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-mvebu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpio/gpio-mvebu.c +2 -5
@@ -1038,11 +1038,9 @@ static int mvebu_gpio_resume(struct platform_device *pdev)static int mvebu_gpio_probe_raw (struct platform_device *pdev,struct mvebu_gpio_chip *mvchip) { -struct resource *res;void __iomem *base; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base))return PTR_ERR (base);
@@ -1062,8 +1060,7 @@ static int mvebu_gpio_probe_raw(struct platform_device *pdev,* per-CPU registers */ if (mvchip->soc_variant ==MVEBU_GPIO_SOC_VARIANT_ARMADAXP ) { - res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); - base =devm_ioremap_resource (&pdev->dev, res); + base =devm_platform_ioremap_resource (pdev,1 );if (IS_ERR (base))return PTR_ERR (base);
Signature · 1 line
1.9.1
Re: [PATCH 21/42] drivers: gpio: mvebu: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 22/42 drivers: gpio: mxc: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-mxc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-mxc.c +1 -3
@@ -411,7 +411,6 @@ static int mxc_gpio_probe(struct platform_device *pdev) {struct device_node *np = pdev->dev.of_node;struct mxc_gpio_port *port; -struct resource *iores;int irq_base;int err;
@@ -423,8 +422,7 @@ static int mxc_gpio_probe(struct platform_device *pdev) port->dev = &pdev->dev; - iores =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - port->base =devm_ioremap_resource (&pdev->dev, iores); + port->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (port->base))return PTR_ERR (port->base);
Signature · 1 line
1.9.1
Re: [PATCH 22/42] drivers: gpio: mxc: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 23/42 drivers: gpio: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-octeon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-octeon.c +1 -3
@@ -82,7 +82,6 @@ static int octeon_gpio_probe(struct platform_device *pdev) {struct octeon_gpio *gpio;struct gpio_chip *chip; -struct resource *res_mem;void __iomem *reg_base;int err =0 ;
@@ -91,8 +90,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)return -ENOMEM ; chip = &gpio->chip; - res_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - reg_base =devm_ioremap_resource (&pdev->dev, res_mem); + reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (reg_base))return PTR_ERR (reg_base);
Signature · 1 line
1.9.1
Re: [PATCH 23/42] drivers: gpio: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
The subject is missing an "octeon: " part here to indicate which driver this applies to.
Maybe you should convert all drivers in one go though?
Signature · 1 line
Florian
PATCH 1/1 drivers: gpio: octeon: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-octeon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-octeon.c +1 -3
@@ -82,7 +82,6 @@ static int octeon_gpio_probe(struct platform_device *pdev) {struct octeon_gpio *gpio;struct gpio_chip *chip; -struct resource *res_mem;void __iomem *reg_base;int err =0 ;
@@ -91,8 +90,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)return -ENOMEM ; chip = &gpio->chip; - res_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - reg_base =devm_ioremap_resource (&pdev->dev, res_mem); + reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (reg_base))return PTR_ERR (reg_base);
Signature · 1 line
1.9.1
Re: [PATCH] drivers: gpio: octeon: use devm_platform_ioremap_resource()
pon., 11 mar 2019 o 20:48 Enrico Weigelt, metux IT consult <[email protected]> napisał(a):
Quoted 32 lines
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-octeon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpio/gpio-octeon.c +1
-4@@ -82,7 +82,6 @@ static int octeon_gpio_probe(struct platform_device *pdev) {struct octeon_gpio *gpio;struct gpio_chip *chip; -struct resource *res_mem;void __iomem *reg_base;int err =0 ;@@ -91,8 +90,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)return -ENOMEM ; chip = &gpio->chip; - res_mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - reg_base =devm_ioremap_resource (&pdev->dev, res_mem); + reg_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (reg_base))return PTR_ERR (reg_base); --
Quoted 2 lines
1.9.1
Can you make this a part of the bigger series and resend together with subject line fixes?
Also: maybe consider adding a coccinelle script for that. When I added that function I noticed there are 1200+ instances in the kernel that need fixing. I think we'll be better off automating it.
Bart
Re: [PATCH] drivers: gpio: octeon: use devm_platform_ioremap_resource()
Quoted 2 lines · Bartosz Golaszewski
Can you make this a part of the bigger series and resend together with subject line fixes?
tried to resend it as reply on the prev version. but somehow this didn't seem to work as intented.
Quoted 3 lines
Also: maybe consider adding a coccinelle script for that. When I added that function I noticed there are 1200+ instances in the kernel that need fixing. I think we'll be better off automating it.
haven't coped w/ this yet ... I'll first need to have a deeper look at it. advices welcomed.
--mtx
Signature · 3 lines
Enrico Weigelt, metux IT consult Free software and Linux embedded engineering [email protected] -- +49-151-27565287
Re: [PATCH] drivers: gpio: octeon: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 24/42 drivers: gpio: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-omap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-omap.c +1 -3
@@ -1289,7 +1289,6 @@ static int omap_gpio_probe(struct platform_device *pdev)struct device_node *node = dev->of_node;const struct of_device_id *match;const struct omap_gpio_platform_data *pdata; -struct resource *res;struct gpio_bank *bank;struct irq_chip *irqc;int ret;
@@ -1375,8 +1374,7 @@ static int omap_gpio_probe(struct platform_device *pdev)raw_spin_lock_init (&bank->wa_lock);/* Static mapping, never released */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - bank->base =devm_ioremap_resource (dev, res); + bank->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (bank->base)) {return PTR_ERR (bank->base); }
Signature · 1 line
1.9.1
Re: [PATCH 24/42] drivers: gpio: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Same here, missing an "omap: " qualifier in the subject. --
Florian
PATCH 1/1 drivers: gpio: omap: use devm_platform_ioremap_resource()
Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-omap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-omap.c +1 -3
@@ -1289,7 +1289,6 @@ static int omap_gpio_probe(struct platform_device *pdev)struct device_node *node = dev->of_node;const struct of_device_id *match;const struct omap_gpio_platform_data *pdata; -struct resource *res;struct gpio_bank *bank;struct irq_chip *irqc;int ret;
@@ -1375,8 +1374,7 @@ static int omap_gpio_probe(struct platform_device *pdev)raw_spin_lock_init (&bank->wa_lock);/* Static mapping, never released */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - bank->base =devm_ioremap_resource (dev, res); + bank->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (bank->base)) {return PTR_ERR (bank->base); }
Signature · 1 line
1.9.1
Re: [PATCH] drivers: gpio: omap: use devm_platform_ioremap_resource()
Quoted 22 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-omap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpio/gpio-omap.c +0
-1@@ -1289,7 +1289,6 @@ static int omap_gpio_probe(struct platform_device *pdev)struct device_node *node = dev->of_node;const struct of_device_id *match;const struct omap_gpio_platform_data *pdata; -struct resource *res;struct gpio_bank *bank;struct irq_chip *irqc;int ret;
drivers/gpio/gpio-omap.c static int omap_gpio_probe(struct platform_device *pdev) · line 1380
Quoted 9 lines
drivers/gpio/gpio-omap.c +1
-2@@ -1375,8 +1374,7 @@ static int omap_gpio_probe(struct platform_device *pdev)raw_spin_lock_init (&bank->wa_lock);/* Static mapping, never released */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - bank->base =devm_ioremap_resource (dev, res); + bank->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (bank->base)) {return PTR_ERR (bank->base); }
Signature · 2 lines
Best regards, grygorii
Re: [PATCH] drivers: gpio: omap: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied with Grygorii's ACK.
Yours,
Linus Walleij
PATCH 25/42 drivers: gpio: pxa: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-pxa.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/gpio/gpio-pxa.c +2 -6
@@ -622,7 +622,6 @@ static int pxa_gpio_probe(struct platform_device *pdev) {struct pxa_gpio_chip *pchip;struct pxa_gpio_bank *c; -struct resource *res;struct clk *clk;struct pxa_gpio_platform_data *info;void __iomem *gpio_reg_base;
@@ -665,11 +664,8 @@ static int pxa_gpio_probe(struct platform_device *pdev) pchip->irq0 = irq0; pchip->irq1 = irq1; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) -return -EINVAL ; - gpio_reg_base =devm_ioremap (&pdev->dev, res->start, -resource_size (res)); + + gpio_reg_base =devm_platform_ioremap_resource (pdev,0 );if (!gpio_reg_base)return -EINVAL ;
Signature · 1 line
1.9.1
Re: [PATCH 25/42] drivers: gpio: pxa: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 26/42 drivers: gpio: rcar: pendantic formatting
In reply to Enrico Weigelt, metux IT consulta tab sneaked in, where it shouldn't be.
--- drivers/gpio/gpio-rcar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-rcar.c +1 -1
@@ -490,7 +490,7 @@ static int gpio_rcar_probe(struct platform_device *pdev) irq_chip->irq_unmask = gpio_rcar_irq_enable; irq_chip->irq_set_type = gpio_rcar_irq_set_type; irq_chip->irq_set_wake = gpio_rcar_irq_set_wake; - irq_chip->flags =IRQCHIP_SET_TYPE_MASKED |IRQCHIP_MASK_ON_SUSPEND ; + irq_chip->flags =IRQCHIP_SET_TYPE_MASKED |IRQCHIP_MASK_ON_SUSPEND ; ret =gpiochip_add_data (gpio_chip, p);if (ret) {
Signature · 1 line
1.9.1
Re: [PATCH 26/42] drivers: gpio: rcar: pendantic formatting
Quoted 1 line · metux IT consult
a tab sneaked in, where it shouldn't be.
Pedantic nitpick: "pendantic" -> "pedantic" in the subject, and start the commit message with a capital letter: "A tab sneaked in [...]".
Thierry
Re: [PATCH 26/42] drivers: gpio: rcar: pendantic formatting
In reply to Enrico Weigelt, metux IT consultCC linux-renesas-soc
Quoted 3 lines · metux IT consult
a tab sneaked in, where it shouldn't be.
Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
With Thierry's comments addressed:
drivers/gpio/gpio-rcar.c static int gpio_rcar_probe(struct platform_device *pdev) · line 496
Quoted 11 lines
drivers/gpio/gpio-rcar.c +1
-1@@ -490,7 +490,7 @@ static int gpio_rcar_probe(struct platform_device *pdev) irq_chip->irq_unmask = gpio_rcar_irq_enable; irq_chip->irq_set_type = gpio_rcar_irq_set_type; irq_chip->irq_set_wake = gpio_rcar_irq_set_wake; - irq_chip->flags =IRQCHIP_SET_TYPE_MASKED |IRQCHIP_MASK_ON_SUSPEND ; + irq_chip->flags =IRQCHIP_SET_TYPE_MASKED |IRQCHIP_MASK_ON_SUSPEND ; ret =gpiochip_add_data (gpio_chip, p);if (ret) {
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 26/42] drivers: gpio: rcar: pendantic formatting
In reply to Enrico Weigelt, metux IT consultQuoted 3 lines · metux IT consult
a tab sneaked in, where it shouldn't be.
Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Waiting for a new version of this patch.
Yours,
Linus Walleij
PATCH 27/42 drivers: gpio: rcar: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-rcar.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpio/gpio-rcar.c +2 -3
@@ -430,7 +430,7 @@ static int gpio_rcar_parse_dt(struct gpio_rcar_priv *p, unsigned int *npins)static int gpio_rcar_probe (struct platform_device *pdev) {struct gpio_rcar_priv *p; -struct resource *io, *irq; +struct resource *irq;struct gpio_chip *gpio_chip;struct irq_chip *irq_chip;struct device *dev = &pdev->dev;
@@ -461,8 +461,7 @@ static int gpio_rcar_probe(struct platform_device *pdev) goto err0; } - io =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - p->base =devm_ioremap_resource (dev, io); + p->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (p->base)) { ret =PTR_ERR (p->base); goto err0;
Signature · 1 line
1.9.1
Re: [PATCH 27/42] drivers: gpio: rcar: use devm_platform_ioremap_resource()
CC linux-renesas-soc
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Quoted 12 lines
drivers/gpio/gpio-rcar.c +1
-1@@ -430,7 +430,7 @@ static int gpio_rcar_parse_dt(struct gpio_rcar_priv *p, unsigned int *npins)static int gpio_rcar_probe (struct platform_device *pdev) {struct gpio_rcar_priv *p; -struct resource *io, *irq; +struct resource *irq;struct gpio_chip *gpio_chip;struct irq_chip *irq_chip;struct device *dev = &pdev->dev;
drivers/gpio/gpio-rcar.c static int gpio_rcar_probe(struct platform_device *pdev) · line 467
Quoted 9 lines
drivers/gpio/gpio-rcar.c +1
-2@@ -461,8 +461,7 @@ static int gpio_rcar_probe(struct platform_device *pdev) goto err0; } - io =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - p->base =devm_ioremap_resource (dev, io); + p->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (p->base)) { ret =PTR_ERR (p->base); goto err0;
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH 27/42] drivers: gpio: rcar: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied with Geert's review.
Yours,
Linus Walleij
PATCH 28/42 drivers: gpio: spear-spics: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-spear-spics.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-spear-spics.c +1 -3
@@ -122,15 +122,13 @@ static int spics_gpio_probe(struct platform_device *pdev) {struct device_node *np = pdev->dev.of_node;struct spear_spics *spics; -struct resource *res;int ret; spics =devm_kzalloc (&pdev->dev,sizeof (*spics),GFP_KERNEL );if (!spics)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - spics->base =devm_ioremap_resource (&pdev->dev, res); + spics->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (spics->base))return PTR_ERR (spics->base);
Signature · 1 line
1.9.1
Re: [PATCH 28/42] drivers: gpio: spear-spics: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 29/42 drivers: gpio: sprd: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-sprd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-sprd.c +1 -3
@@ -219,7 +219,6 @@ static int sprd_gpio_probe(struct platform_device *pdev) {struct gpio_irq_chip *irq;struct sprd_gpio *sprd_gpio; -struct resource *res;int ret; sprd_gpio =devm_kzalloc (&pdev->dev,sizeof (*sprd_gpio),GFP_KERNEL );
@@ -232,8 +231,7 @@ static int sprd_gpio_probe(struct platform_device *pdev)return sprd_gpio->irq; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - sprd_gpio->base =devm_ioremap_resource (&pdev->dev, res); + sprd_gpio->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (sprd_gpio->base))return PTR_ERR (sprd_gpio->base);
Signature · 1 line
1.9.1
Re: [PATCH 29/42] drivers: gpio: sprd: use devm_platform_ioremap_resource()
Hi,
Quoted 22 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-sprd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpio/gpio-sprd.c +0
-1@@ -219,7 +219,6 @@ static int sprd_gpio_probe(struct platform_device *pdev) {struct gpio_irq_chip *irq;struct sprd_gpio *sprd_gpio; -struct resource *res;int ret; sprd_gpio =devm_kzalloc (&pdev->dev,sizeof (*sprd_gpio),GFP_KERNEL );
drivers/gpio/gpio-sprd.c static int sprd_gpio_probe(struct platform_device *pdev) · line 237
Quoted 9 lines
drivers/gpio/gpio-sprd.c +1
-2@@ -232,8 +231,7 @@ static int sprd_gpio_probe(struct platform_device *pdev)return sprd_gpio->irq; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - sprd_gpio->base =devm_ioremap_resource (&pdev->dev, res); + sprd_gpio->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (sprd_gpio->base))return PTR_ERR (sprd_gpio->base);
Thanks for your patch.
Signature · 2 lines
Baolin Wang Best Regards
Re: [PATCH 29/42] drivers: gpio: sprd: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied with Baolin's ACK.
Yours,
Linus Walleij
Re: [PATCH 29/42] drivers: gpio: sprd: use devm_platform_ioremap_resource()
Hi Linus,
Quoted 10 lines · Linus Walleij
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>Patch applied with Baolin's ACK.
This patch had some problems which I've pointed out and I did not ack this patch. Please do not apply it now until fixing the problem.
Signature · 2 lines
Baolin Wang Best Regards
Linus Walleij
Reviewed-by Baolin WangRe: [PATCH 29/42] drivers: gpio: sprd: use devm_platform_ioremap_resource()
Quoted 8 lines · Baolin Wang
Quoted 7 lines · Linus Walleij
Quoted 3 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>Patch applied with Baolin's ACK.
This patch had some problems which I've pointed out and I did not ack this patch. Please do not apply it now until fixing the problem.
Sorry, it's the gmail threading that confuse the different patches.
The patch I actually applied is for gpio-sprd.c and looks like this:
commit 851f66daeab961328507dcce0980cd7e4ff5f9ae (HEAD -> devel)
Author: Enrico Weigelt, metux IT consult <[email protected]> Date: Mon Mar 11 19:55:08 2019 +0100
drivers: gpio: sprd: use devm_platform_ioremap_resource()
Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
drivers/gpio/gpio-sprd.c +1 -3
@@ -219,7 +219,6 @@ static int sprd_gpio_probe(struct platform_device *pdev) {struct gpio_irq_chip *irq;struct sprd_gpio *sprd_gpio; -struct resource *res;int ret; sprd_gpio =devm_kzalloc (&pdev->dev,sizeof (*sprd_gpio),GFP_KERNEL );
@@ -232,8 +231,7 @@ static int sprd_gpio_probe(struct platform_device *pdev)return sprd_gpio->irq; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - sprd_gpio->base =devm_ioremap_resource (&pdev->dev, res); + sprd_gpio->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (sprd_gpio->base))return PTR_ERR (sprd_gpio->base);
Yours,
Linus Walleij
Re: [PATCH 29/42] drivers: gpio: sprd: use devm_platform_ioremap_resource()
Quoted 12 lines · Linus Walleij
Quoted 10 lines · Baolin Wang
Quoted 9 lines · Linus Walleij
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Patch applied with Baolin's ACK.
This patch had some problems which I've pointed out and I did not ack this patch. Please do not apply it now until fixing the problem.
Sorry, it's the gmail threading that confuse the different patches.
The patch I actually applied is for
gpio-sprd.cand looks like this:
Yes, this one is correct. Thanks :)
Quoted 38 lines
commit
851f66daeab961328507dcce0980cd7e4ff5f9ae(HEAD -> devel)Author: Enrico Weigelt, metux IT consult <[email protected]> Date: Mon Mar 11 19:55:08 2019 +0100drivers: gpio: sprd: use
devm_platform_ioremap_resource()Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>Reviewed-by Baolin Wang <[email protected]>Signed-off-by Linus Walleij <[email protected]>drivers/gpio/gpio-sprd.c +1
-3@@ -219,7 +219,6 @@ static int sprd_gpio_probe(struct platform_device *pdev) {struct gpio_irq_chip *irq;struct sprd_gpio *sprd_gpio; -struct resource *res;int ret; sprd_gpio =devm_kzalloc (&pdev->dev,sizeof (*sprd_gpio),GFP_KERNEL );@@ -232,8 +231,7 @@ static int sprd_gpio_probe(struct platform_device *pdev)return sprd_gpio->irq; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - sprd_gpio->base =devm_ioremap_resource (&pdev->dev, res); + sprd_gpio->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (sprd_gpio->base))return PTR_ERR (sprd_gpio->base);Yours,
Linus Walleij
Signature · 2 lines
Baolin Wang Best Regards
PATCH 30/42 drivers: gpio: sta2x11: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-sta2x11.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpio/gpio-sta2x11.c +1 -4
@@ -360,7 +360,6 @@ static int gsta_probe(struct platform_device *dev)struct pci_dev *pdev;struct sta2x11_gpio_pdata *gpio_pdata;struct gsta_gpio *chip; -struct resource *res; pdev = *(struct pci_dev **)dev_get_platdata (&dev->dev); gpio_pdata =dev_get_platdata (&pdev->dev);
@@ -369,13 +368,11 @@ static int gsta_probe(struct platform_device *dev)dev_err (&dev->dev,"no gpio config\n" );pr_debug ("gpio config: %p\n" , gpio_pdata); - res =platform_get_resource (dev,IORESOURCE_MEM ,0 ); - chip =devm_kzalloc (&dev->dev,sizeof (*chip),GFP_KERNEL );if (!chip)return -ENOMEM ; chip->dev = &dev->dev; - chip->reg_base =devm_ioremap_resource (&dev->dev, res); + chip->reg_base =devm_platform_ioremap_resource (dev,0 );if (IS_ERR (chip->reg_base))return PTR_ERR (chip->reg_base);
Signature · 1 line
1.9.1
Re: [PATCH 30/42] drivers: gpio: sta2x11: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 31/42 drivers: gpio: stp-xway: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-stp-xway.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-stp-xway.c +1 -3
@@ -210,7 +210,6 @@ static int xway_stp_hw_init(struct xway_stp *chip)static int xway_stp_probe (struct platform_device *pdev) { -struct resource *res;u32 shadow, groups, dsl, phy;struct xway_stp *chip;struct clk *clk;
@@ -220,8 +219,7 @@ static int xway_stp_probe(struct platform_device *pdev)if (!chip)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - chip->virt =devm_ioremap_resource (&pdev->dev, res); + chip->virt =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (chip->virt))return PTR_ERR (chip->virt);
Signature · 1 line
1.9.1
Re: [PATCH 31/42] drivers: gpio: stp-xway: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 32/42 drivers: gpio: tb10x: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-tb10x.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-tb10x.c +1 -3
@@ -120,7 +120,6 @@ static irqreturn_t tb10x_gpio_irq_cascade(int irq, void *data)static int tb10x_gpio_probe (struct platform_device *pdev) {struct tb10x_gpio *tb10x_gpio; -struct resource *mem;struct device *dev = &pdev->dev;struct device_node *np = dev->of_node;int ret = -EBUSY ;
@@ -136,8 +135,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)if (tb10x_gpio ==NULL )return -ENOMEM ; - mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - tb10x_gpio->base =devm_ioremap_resource (dev, mem); + tb10x_gpio->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (tb10x_gpio->base))return PTR_ERR (tb10x_gpio->base);
Signature · 1 line
1.9.1
Re: [PATCH 32/42] drivers: gpio: tb10x: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 33/42 drivers: gpio: tegra: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-tegra.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-tegra.c +1 -3
@@ -569,7 +569,6 @@ static inline void tegra_gpio_debuginit(struct tegra_gpio_info *tgi)static int tegra_gpio_probe (struct platform_device *pdev) {struct tegra_gpio_info *tgi; -struct resource *res;struct tegra_gpio_bank *bank;unsigned int gpio, i, j;int ret;
@@ -645,8 +644,7 @@ static int tegra_gpio_probe(struct platform_device *pdev) bank->tgi = tgi; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - tgi->regs =devm_ioremap_resource (&pdev->dev, res); + tgi->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (tgi->regs))return PTR_ERR (tgi->regs);
Signature · 1 line
1.9.1
Re: [PATCH 33/42] drivers: gpio: tegra: use devm_platform_ioremap_resource()
Quoted 7 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-tegra.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Re: [PATCH 33/42] drivers: gpio: tegra: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied with Thierry's ACK.
Yours,
Linus Walleij
PATCH 34/42 drivers: gpio: timberdale: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-timberdale.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-timberdale.c +1 -3
@@ -229,7 +229,6 @@ static int timbgpio_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct gpio_chip *gc;struct timbgpio *tgpio; -struct resource *iomem;struct timbgpio_platform_data *pdata =dev_get_platdata (&pdev->dev);int irq =platform_get_irq (pdev,0 );
@@ -246,8 +245,7 @@ static int timbgpio_probe(struct platform_device *pdev)spin_lock_init (&tgpio->lock); - iomem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - tgpio->membase =devm_ioremap_resource (dev, iomem); + tgpio->membase =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (tgpio->membase))return PTR_ERR (tgpio->membase);
Signature · 1 line
1.9.1
Re: [PATCH 34/42] drivers: gpio: timberdale: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 35/42 drivers: gpio: ts4800: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-ts4800.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-ts4800.c +1 -3
@@ -23,7 +23,6 @@ static int ts4800_gpio_probe(struct platform_device *pdev) {struct device_node *node;struct gpio_chip *chip; -struct resource *res;void __iomem *base_addr;int retval;u32 ngpios;
@@ -32,8 +31,7 @@ static int ts4800_gpio_probe(struct platform_device *pdev)if (!chip)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - base_addr =devm_ioremap_resource (&pdev->dev, res); + base_addr =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (base_addr))return PTR_ERR (base_addr);
Signature · 1 line
1.9.1
Re: [PATCH 35/42] drivers: gpio: ts4800: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 36/42 drivers: gpio: uniphier: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-uniphier.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-uniphier.c +1 -3
@@ -346,7 +346,6 @@ static int uniphier_gpio_probe(struct platform_device *pdev)struct uniphier_gpio_priv *priv;struct gpio_chip *chip;struct irq_chip *irq_chip; -struct resource *regs;unsigned int nregs;u32 ngpios;int ret;
@@ -370,8 +369,7 @@ static int uniphier_gpio_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; - regs =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - priv->regs =devm_ioremap_resource (dev, regs); + priv->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->regs))return PTR_ERR (priv->regs);
Signature · 1 line
1.9.1
Re: [PATCH 36/42] drivers: gpio: uniphier: use devm_platform_ioremap_resource()
Quoted 6 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>---
Quoted 28 lines
drivers/gpio/gpio-uniphier.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpio/gpio-uniphier.c +1
-4@@ -346,7 +346,6 @@ static int uniphier_gpio_probe(struct platform_device *pdev)struct uniphier_gpio_priv *priv;struct gpio_chip *chip;struct irq_chip *irq_chip; -struct resource *regs;unsigned int nregs;u32 ngpios;int ret;@@ -370,8 +369,7 @@ static int uniphier_gpio_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; - regs =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - priv->regs =devm_ioremap_resource (dev, regs); + priv->regs =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (priv->regs))return PTR_ERR (priv->regs); --1.9.1
Signature · 2 lines
Best Regards Masahiro Yamada
Re: [PATCH 36/42] drivers: gpio: uniphier: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied with Masahiro's ACK.
Yours,
Linus Walleij
PATCH 37/42 drivers: gpio: vf610: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-vf610.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpio/gpio-vf610.c +2 -5
@@ -251,7 +251,6 @@ static int vf610_gpio_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np = dev->of_node;struct vf610_gpio_port *port; -struct resource *iores;struct gpio_chip *gc;int i;int ret;
@@ -261,13 +260,11 @@ static int vf610_gpio_probe(struct platform_device *pdev)return -ENOMEM ; port->sdata =of_device_get_match_data (dev); - iores =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - port->base =devm_ioremap_resource (dev, iores); + port->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (port->base))return PTR_ERR (port->base); - iores =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); - port->gpio_base =devm_ioremap_resource (dev, iores); + port->gpio_base =devm_platform_ioremap_resource (pdev,1 );if (IS_ERR (port->gpio_base))return PTR_ERR (port->gpio_base);
Signature · 1 line
1.9.1
Re: [PATCH 37/42] drivers: gpio: vf610: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 38/42 drivers: gpio: vr41xx: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
this driver deserves a bit more cleanup, to get rid of the global variable giu_base, which makes it single-instance-only.
--- drivers/gpio/gpio-vr41xx.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)
drivers/gpio/gpio-vr41xx.c +5 -14
@@ -467,10 +467,9 @@ static int vr41xx_gpio_to_irq(struct gpio_chip *chip, unsigned offset)static int giu_probe (struct platform_device *pdev) { -struct resource *res;unsigned int trigger, i, pin;struct irq_chip *chip; -int irq, ret; +int irq;switch (pdev->id) {case GPIO_50PINS_PULLUPDOWN :
@@ -489,21 +488,14 @@ static int giu_probe(struct platform_device *pdev)return -ENODEV ; } - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) -return -EBUSY ; - - giu_base =ioremap (res->start,resource_size (res)); -if (!giu_base) -return -ENOMEM ; + giu_base =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (giu_base)) +return PTR_ERR (giu_base); vr41xx_gpio_chip.parent = &pdev->dev; - ret =gpiochip_add_data (&vr41xx_gpio_chip,NULL ); -if (!ret) { -iounmap (giu_base); +if (gpiochip_add_data (&vr41xx_gpio_chip,NULL ))return -ENODEV ; - }giu_write (GIUINTENL ,0 );giu_write (GIUINTENH ,0 );
@@ -534,7 +526,6 @@ static int giu_probe(struct platform_device *pdev)static int giu_remove (struct platform_device *pdev) {if (giu_base) { -iounmap (giu_base); giu_base =NULL ; }
Signature · 1 line
1.9.1
Re: [PATCH 38/42] drivers: gpio: vr41xx: use devm_platform_ioremap_resource()
Quoted 31 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.this driver deserves a bit more cleanup, to get rid of the global variable
giu_base, which makes it single-instance-only.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-vr41xx.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-)drivers/gpio/gpio-vr41xx.c +1
-2@@ -467,10 +467,9 @@ static int vr41xx_gpio_to_irq(struct gpio_chip *chip, unsigned offset)static int giu_probe (struct platform_device *pdev) { -struct resource *res;unsigned int trigger, i, pin;struct irq_chip *chip; -int irq, ret; +int irq;switch (pdev->id) {case GPIO_50PINS_PULLUPDOWN :@@ -489,21 +488,14 @@ static int giu_probe(struct platform_device *pdev)return -ENODEV ; }
drivers/gpio/gpio-vr41xx.c static int giu_probe(struct platform_device *pdev) · line 493
Quoted 10 lines
drivers/gpio/gpio-vr41xx.c +3
-7- res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!res) -return -EBUSY ; - - giu_base =ioremap (res->start,resource_size (res)); -if (!giu_base) -return -ENOMEM ; + giu_base =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (giu_base)) +return PTR_ERR (giu_base);
The driver currently doesn't request the memory described in the resource, so technically you're changing behaviour here and with your change the driver could now fail if somebody else has already claimed the memory.
Looking at arch/mips/vr41xx there doesn't seem to be an overlap between the memory region used by the GIU device and any others, so this should be safe. Not sure anyone still has hardware for this around to give it a spin.
Thierry
Quoted 23 lines
drivers/gpio/gpio-vr41xx.c +1
-5vr41xx_gpio_chip.parent = &pdev->dev; - ret =gpiochip_add_data (&vr41xx_gpio_chip,NULL ); -if (!ret) { -iounmap (giu_base); +if (gpiochip_add_data (&vr41xx_gpio_chip,NULL ))return -ENODEV ; - }giu_write (GIUINTENL ,0 );giu_write (GIUINTENH ,0 );@@ -534,7 +526,6 @@ static int giu_probe(struct platform_device *pdev)static int giu_remove (struct platform_device *pdev) {if (giu_base) { -iounmap (giu_base); giu_base =NULL ; }Signature · 1 line
1.9.1
Re: [PATCH 38/42] drivers: gpio: vr41xx: use devm_platform_ioremap_resource()
Quoted 4 lines · Thierry Reding
The driver currently doesn't request the memory described in the resource, so technically you're changing behaviour here and with your change the driver could now fail if somebody else has already claimed the memory.
hmm, using w/o requesting/claiming - isn't that a bug ?
--mtx
Signature · 3 lines
Enrico Weigelt, metux IT consult Free software and Linux embedded engineering [email protected] -- +49-151-27565287
Re: [PATCH 38/42] drivers: gpio: vr41xx: use devm_platform_ioremap_resource()
Quoted 8 lines · metux IT consult
Quoted 4 lines · Thierry Reding
The driver currently doesn't request the memory described in the resource, so technically you're changing behaviour here and with your change the driver could now fail if somebody else has already claimed the memory.
hmm, using w/o requesting/claiming - isn't that a bug ?
Not necessarily, before regmap existed, you could have very well delegated a subset of a larger resource to a specific driver while a driver requesting that larger resource would be responsible for doing the request_mem_region(). As long as both drivers don't stomp on each other, this is a perfectly valid way to delegate, yet keep things modular/separate.
Signature · 1 line
Florian
Re: [PATCH 38/42] drivers: gpio: vr41xx: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 7 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.this driver deserves a bit more cleanup, to get rid of the global variable
giu_base, which makes it single-instance-only.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Holding this back until we have more consensus and some ACKs.
Yours,
Linus Walleij
PATCH 39/42 drivers: gpio: xgene-sb: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-xgene-sb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-xgene-sb.c +1 -3
@@ -229,7 +229,6 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev) {struct xgene_gpio_sb *priv;int ret; -struct resource *res;void __iomem *regs;struct irq_domain *parent_domain =NULL ;u32 val32;
@@ -238,8 +237,7 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)if (!priv)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))return PTR_ERR (regs);
Signature · 1 line
1.9.1
Re: [PATCH 39/42] drivers: gpio: xgene-sb: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 40/42 drivers: gpio: zx: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-zx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-zx.c +1 -3
@@ -218,15 +218,13 @@ static int zx_gpio_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct zx_gpio *chip; -struct resource *res;int irq, id, ret; chip =devm_kzalloc (dev,sizeof (*chip),GFP_KERNEL );if (!chip)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - chip->base =devm_ioremap_resource (dev, res); + chip->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (chip->base))return PTR_ERR (chip->base);
Signature · 1 line
1.9.1
Re: [PATCH 40/42] drivers: gpio: zx: use devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 41/42 drivers: gpio: xlp: devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-xlp.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpio/gpio-xlp.c +1 -6
@@ -290,22 +290,17 @@ static void xlp_gpio_set(struct gpio_chip *gc, unsigned gpio, int state)static int xlp_gpio_probe (struct platform_device *pdev) {struct gpio_chip *gc; -struct resource *iores;struct xlp_gpio_priv *priv;void __iomem *gpio_base;int irq_base, irq, err;int ngpio;u32 soc_type; - iores =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!iores) -return -ENODEV ; - priv =devm_kzalloc (&pdev->dev,sizeof (*priv),GFP_KERNEL );if (!priv)return -ENOMEM ; - gpio_base =devm_ioremap_resource (&pdev->dev, iores); + gpio_base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (gpio_base))return PTR_ERR (gpio_base);
Signature · 1 line
1.9.1
Re: [PATCH 41/42] drivers: gpio: xlp: devm_platform_ioremap_resource()
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 42/42 drivers: gpio: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultUse the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.
--- drivers/gpio/gpio-zynq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-zynq.c +1 -3
@@ -834,7 +834,6 @@ static int zynq_gpio_probe(struct platform_device *pdev)int ret, bank_num;struct zynq_gpio *gpio;struct gpio_chip *chip; -struct resource *res;const struct of_device_id *match; gpio =devm_kzalloc (&pdev->dev,sizeof (*gpio),GFP_KERNEL );
@@ -849,8 +848,7 @@ static int zynq_gpio_probe(struct platform_device *pdev) gpio->p_data = match->data;platform_set_drvdata (pdev, gpio); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - gpio->base_addr =devm_ioremap_resource (&pdev->dev, res); + gpio->base_addr =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (gpio->base_addr))return PTR_ERR (gpio->base_addr);
Signature · 1 line
1.9.1
Re: [PATCH 42/42] drivers: gpio: use devm_platform_ioremap_resource()
Quoted 7 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- drivers/gpio/gpio-zynq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Subject prefix doesn't seem to match for this driver.
Thierry
Re: [PATCH 42/42] drivers: gpio: use devm_platform_ioremap_resource()
In reply to Enrico Weigelt, metux IT consultQuoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Changed subject to gpio: zynq: and applied.
Yours,
Linus Walleij
Quoted 4 lines · metux IT consult
Use the new helper that wraps the calls to
platform_get_resource()anddevm_ioremap_resource()together.Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>
Patch applied.
Yours,
Linus Walleij