# \[PATCH 0/29\] simplify use of devm\_ioremap\_resource

- Subsystems: ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES, ARM PRIMECELL BUS SUPPORT, BROADCOM BCM6348/BCM6358 SPI controller DRIVER, CPU IDLE TIME MANAGEMENT FRAMEWORK, DESIGNWARE USB3 DRD IP DRIVER, DMA GENERIC OFFLOAD ENGINE SUBSYSTEM, DRM DRIVERS, DRM DRIVERS FOR NVIDIA TEGRA, FRAMEBUFFER LAYER, GPIO SUBSYSTEM, HARDWARE RANDOM NUMBER GENERATOR CORE, I2C SUBSYSTEM, I2C SUBSYSTEM HOST DRIVERS, INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS, IOMMU SUBSYSTEM, LIBATA SUBSYSTEM (Serial and Parallel ATA drivers), MEDIA INPUT INFRASTRUCTURE (V4L/DVB), MEMORY CONTROLLER DRIVERS, MEMORY TECHNOLOGY DEVICES (MTD), NAND FLASH SUBSYSTEM, OMAP USB SUPPORT, OPENCORES I2C BUS DRIVER, PIN CONTROL SUBSYSTEM, PWM SUBSYSTEM, REAL TIME CLOCK (RTC) SUBSYSTEM, REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM, RENESAS R-CAR SATA DRIVER, SAMSUNG AUDIO (ASoC) DRIVERS, SCSI SUBSYSTEM, SOUND, SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC), SPI SUBSYSTEM, TEGRA IOMMU DRIVERS, TEGRA KBC DRIVER, THE REST, TTY LAYER AND SERIAL DRIVERS, USB SUBSYSTEM, WATCHDOG DEVICE DRIVERS
- Maintainers: Krzysztof Kozlowski, Peter Griffin, Russell King, Jonas Gorski, "Rafael J. Wysocki", Daniel Lezcano, Thinh Nguyen, Vinod Koul, David Airlie, Simona Vetter, Thierry Reding, Mikko Perttunen, Helge Deller, Linus Walleij, Bartosz Golaszewski, Olivia Mackall, Herbert Xu, Andi Shyti, Dmitry Torokhov, Joerg Roedel, Will Deacon, Damien Le Moal, Niklas Cassel, Mauro Carvalho Chehab, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Peter Korsgaard, Andrew Lunn, Uwe Kleine-König, Alexandre Belloni, Bjorn Andersson, Mathieu Poirier, Geert Uytterhoeven, Sylwester Nawrocki, "James E.J. Bottomley", "Martin K. Petersen", Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown, Laxman Dewangan, Linus Torvalds, Greg Kroah-Hartman, Jiri Slaby, Wim Van Sebroeck, Guenter Roeck
- Series: 28 patches touching 39 files, +21/-196
- List: linux-arm-kernel
- 13 messages, 6 authors
- Page: https://ratatoskr.run/linux-arm-kernel/2013/08/4100536/t

## \[PATCH 0/29\] simplify use of devm\_ioremap\_resource

- From: Julia Lawall \<hidden\>
- Date: 2013-08-14 09:18:54 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4100536.md

```text
devm_ioremap_resource often uses the result of a call to
platform_get_resource as its last argument.  devm_ioremap_resource does
appropriate error handling on this argument, so error handling can be
removed from the call site.  To make the connection between the call to
platform_get_resource and the call to devm_ioremap_resource more clear, the
former is also moved down to be adjacent to the latter.

In many cases, this patch changes the specific error value that is
returned on failure of platform_get_resource.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@

(
  res = platform_get_resource(pdev, IORESOURCE_MEM, n);
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  e = devm_ioremap_resource(e1, res);
|
- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  ... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  ... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  e = devm_ioremap_resource(e1, res);
)
// </smpl>
```

## \[PATCH 1/29\] pinctrl: nomadik: simplify use of devm\_ioremap\_resource

- From: Julia Lawall \<hidden\>
- Date: 2013-08-14 09:11:39 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4100508.md

```text
From: Julia Lawall <redacted>

Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to devm_ioremap_resource.

Move the call to platform_get_resource adjacent to the call to
devm_ioremap_resource to make the connection between them more clear.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@

- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  ... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  ... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  e = devm_ioremap_resource(e1, res);
// </smpl>

Signed-off-by: Julia Lawall <redacted>

---
 drivers/pinctrl/pinctrl-nomadik.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index 89280bc..be126fc 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -1055,10 +1055,6 @@ static int nmk_gpio_probe(struct platform_device *dev)
 		pdata->num_gpio   = NMK_GPIO_PER_CHIP;
 	}
 
-	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENOENT;
-
 	irq = platform_get_irq(dev, 0);
 	if (irq < 0)
 		return irq;
@@ -1067,6 +1063,7 @@ static int nmk_gpio_probe(struct platform_device *dev)
 	if (secondary_irq >= 0 && !pdata->get_secondary_status)
 		return -EINVAL;
 
+	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
 	base = devm_ioremap_resource(&dev->dev, res);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
```

## \[PATCH 25/29\] drivers/spi/spi-sirf.c: simplify use of devm\_ioremap\_resource

- From: Julia Lawall \<hidden\>
- Date: 2013-08-14 09:12:28 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4100513.md

```text
From: Julia Lawall <redacted>

Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to devm_ioremap_resource.

Move the call to platform_get_resource adjacent to the call to
devm_ioremap_resource to make the connection between them more clear.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@

- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  ... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  ... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  e = devm_ioremap_resource(e1, res);
// </smpl>

Signed-off-by: Julia Lawall <redacted>

---
 drivers/spi/spi-sirf.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index 62c92c3..546fae2 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -588,12 +588,6 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, master);
 	sspi = spi_master_get_devdata(master);
 
-	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!mem_res) {
-		dev_err(&pdev->dev, "Unable to get IO resource\n");
-		ret = -ENODEV;
-		goto free_master;
-	}
 	master->num_chipselect = num_cs;
 
 	for (i = 0; i < master->num_chipselect; i++) {
@@ -620,6 +614,7 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 		}
 	}
 
+	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	sspi->base = devm_ioremap_resource(&pdev->dev, mem_res);
 	if (IS_ERR(sspi->base)) {
 		ret = PTR_ERR(sspi->base);
```

## \[PATCH 20/29\] watchdog: s3c2410\_wdt: simplify use of devm\_ioremap\_resource

- From: Julia Lawall \<hidden\>
- Date: 2013-08-14 09:14:46 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4100521.md

```text
From: Julia Lawall <redacted>

Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to devm_ioremap_resource.

Move the call to platform_get_resource adjacent to the call to
devm_ioremap_resource to make the connection between them more clear.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@

- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  ... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  ... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  e = devm_ioremap_resource(e1, res);
// </smpl>

Signed-off-by: Julia Lawall <redacted>

---
 drivers/watchdog/s3c2410_wdt.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 6a22cf5..9fbc993 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -325,12 +325,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
 	dev = &pdev->dev;
 	wdt_dev = &pdev->dev;
 
-	wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (wdt_mem == NULL) {
-		dev_err(dev, "no memory resource specified\n");
-		return -ENOENT;
-	}
-
 	wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (wdt_irq == NULL) {
 		dev_err(dev, "no irq resource specified\n");
@@ -339,6 +333,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
 	}
 
 	/* get the memory region for the watchdog timer */
+	wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	wdt_base = devm_ioremap_resource(dev, wdt_mem);
 	if (IS_ERR(wdt_base)) {
 		ret = PTR_ERR(wdt_base);
```

## \[PATCH 12/29\] sound/soc/samsung/ac97.c: simplify use of devm\_ioremap\_resource

- From: Julia Lawall \<hidden\>
- Date: 2013-08-14 09:18:21 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4100532.md

```text
From: Julia Lawall <redacted>

Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to devm_ioremap_resource.

Move the call to platform_get_resource adjacent to the call to
devm_ioremap_resource to make the connection between them more clear.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@

- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  ... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  ... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  e = devm_ioremap_resource(e1, res);
// </smpl>

Signed-off-by: Julia Lawall <redacted>

---
 sound/soc/samsung/ac97.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c
index 2dd623f..c732df9 100644
--- a/sound/soc/samsung/ac97.c
+++ b/sound/soc/samsung/ac97.c
@@ -404,18 +404,13 @@ static int s3c_ac97_probe(struct platform_device *pdev)
 		return -ENXIO;
 	}
 
-	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!mem_res) {
-		dev_err(&pdev->dev, "Unable to get register resource\n");
-		return -ENXIO;
-	}
-
 	irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (!irq_res) {
 		dev_err(&pdev->dev, "AC97 IRQ not provided!\n");
 		return -ENXIO;
 	}
 
+	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	s3c_ac97.regs = devm_ioremap_resource(&pdev->dev, mem_res);
 	if (IS_ERR(s3c_ac97.regs))
 		return PTR_ERR(s3c_ac97.regs);
```

## \[PATCH 10/29\] drivers/watchdog/nuc900\_wdt.c: simplify use of devm\_ioremap\_resource

- From: Julia Lawall \<hidden\>
- Date: 2013-08-14 09:18:57 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4100535.md

```text
From: Julia Lawall <redacted>

Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to devm_ioremap_resource.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@

- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  ... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  ... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  e = devm_ioremap_resource(e1, res);
// </smpl>

Signed-off-by: Julia Lawall <redacted>

---
 drivers/watchdog/nuc900_wdt.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/watchdog/nuc900_wdt.c b/drivers/watchdog/nuc900_wdt.c
index e2b6d2c..b15b6ef 100644
--- a/drivers/watchdog/nuc900_wdt.c
+++ b/drivers/watchdog/nuc900_wdt.c
@@ -256,11 +256,6 @@ static int nuc900wdt_probe(struct platform_device *pdev)
 	spin_lock_init(&nuc900_wdt->wdt_lock);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (res == NULL) {
-		dev_err(&pdev->dev, "no memory resource specified\n");
-		return -ENOENT;
-	}
-
 	nuc900_wdt->wdt_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(nuc900_wdt->wdt_base))
 		return PTR_ERR(nuc900_wdt->wdt_base);
```

## RE: \[PATCH 25/29\] drivers/spi/spi-sirf.c: simplify use of devm\_ioremap\_resource

- From: Barry Song \<hidden\>
- Date: 2013-08-14 10:20:57 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4100582.md

```text
> -----Original Message-----
> From: Julia Lawall [mailto:Julia.Lawall at lip6.fr]
> Sent: Wednesday, August 14, 2013 5:11 PM
> To: Barry Song
> Cc: kernel-janitors at vger.kernel.org; Mark Brown;
> linux-arm-kernel at lists.infradead.org; linux-spi at vger.kernel.org;
> linux-kernel at vger.kernel.org
> Subject: [PATCH 25/29] drivers/spi/spi-sirf.c: simplify use of
> devm_ioremap_resource
> 
> From: Julia Lawall <redacted>
> 
> Remove unneeded error handling on the result of a call to
> platform_get_resource when the value is passed to devm_ioremap_resource.
> 
> Move the call to platform_get_resource adjacent to the call to
> devm_ioremap_resource to make the connection between them more clear.
> 
> A simplified version of the semantic patch that makes this change is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression pdev,res,n,e,e1;
> expression ret != 0;
> identifier l;
> @@
> 
> - res = platform_get_resource(pdev, IORESOURCE_MEM, n);
>   ... when != res
> - if (res == NULL) { ... \(goto l;\|return ret;\) }
>   ... when != res
> + res = platform_get_resource(pdev, IORESOURCE_MEM, n);
>   e = devm_ioremap_resource(e1, res);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <redacted>

Acked-by: Barry Song <redacted>

> 
> ---
>  drivers/spi/spi-sirf.c |    7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
 


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
```

## Re: \[PATCH 25/29\] drivers/spi/spi-sirf.c: simplify use of devm\_ioremap\_resource

- From: Mark Brown \<broonie@kernel.org\>
- Date: 2013-08-14 18:09:34 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4100964.md

```text
On Wed, Aug 14, 2013 at 11:11:29AM +0200, Julia Lawall wrote:
> From: Julia Lawall <redacted>
> 
> Remove unneeded error handling on the result of a call to
> platform_get_resource when the value is passed to devm_ioremap_resource.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130814/5588ecf8/attachment.sig>
```

## Re: \[PATCH 12/29\] sound/soc/samsung/ac97.c: simplify use of devm\_ioremap\_resource

- From: Mark Brown \<broonie@kernel.org\>
- Date: 2013-08-14 18:15:36 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4100969.md

```text
On Wed, Aug 14, 2013 at 11:11:16AM +0200, Julia Lawall wrote:
> From: Julia Lawall <redacted>
> 
> Remove unneeded error handling on the result of a call to
> platform_get_resource when the value is passed to devm_ioremap_resource.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130814/ded7bb4e/attachment-0001.sig>
```

## Re: \[PATCH 10/29\] drivers/watchdog/nuc900\_wdt.c: simplify use of devm\_ioremap\_resource

- From: Guenter Roeck \<linux@roeck-us.net\>
- Date: 2013-08-15 03:17:14 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4101250.md

```text
On 08/14/2013 02:11 AM, Julia Lawall wrote:
> From: Julia Lawall <redacted>
>
> Remove unneeded error handling on the result of a call to
> platform_get_resource when the value is passed to devm_ioremap_resource.
>
> A simplified version of the semantic patch that makes this change is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression pdev,res,n,e,e1;
> expression ret != 0;
> identifier l;
> @@
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, n);
>    ... when != res
> - if (res == NULL) { ... \(goto l;\|return ret;\) }
>    ... when != res
> + res = platform_get_resource(pdev, IORESOURCE_MEM, n);
>    e = devm_ioremap_resource(e1, res);
> // </smpl>
>
> Signed-off-by: Julia Lawall <redacted>
>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
```

## Re: \[PATCH 20/29\] watchdog: s3c2410\_wdt: simplify use of devm\_ioremap\_resource

- From: Guenter Roeck \<linux@roeck-us.net\>
- Date: 2013-08-15 03:19:45 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4101252.md

```text
On 08/14/2013 02:11 AM, Julia Lawall wrote:
> From: Julia Lawall <redacted>
>
> Remove unneeded error handling on the result of a call to
> platform_get_resource when the value is passed to devm_ioremap_resource.
>
> Move the call to platform_get_resource adjacent to the call to
> devm_ioremap_resource to make the connection between them more clear.
>
> A simplified version of the semantic patch that makes this change is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression pdev,res,n,e,e1;
> expression ret != 0;
> identifier l;
> @@
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, n);
>    ... when != res
> - if (res == NULL) { ... \(goto l;\|return ret;\) }
>    ... when != res
> + res = platform_get_resource(pdev, IORESOURCE_MEM, n);
>    e = devm_ioremap_resource(e1, res);
> // </smpl>
>
> Signed-off-by: Julia Lawall <redacted>
>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
```

## Re: \[PATCH 10/29\] drivers/watchdog/nuc900\_wdt.c: simplify use of devm\_ioremap\_resource

- From: Wan ZongShun \<hidden\>
- Date: 2013-08-15 03:29:41 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4101256.md

```text
2013/8/15 Guenter Roeck [ref]:
> On 08/14/2013 02:11 AM, Julia Lawall wrote:
>>
>> From: Julia Lawall <redacted>
>>
>> Remove unneeded error handling on the result of a call to
>> platform_get_resource when the value is passed to devm_ioremap_resource.
>>
>> A simplified version of the semantic patch that makes this change is as
>> follows: (http://coccinelle.lip6.fr/)
>>
>> // <smpl>
>> @@
>> expression pdev,res,n,e,e1;
>> expression ret != 0;
>> identifier l;
>> @@
>>
>> - res = platform_get_resource(pdev, IORESOURCE_MEM, n);
>>    ... when != res
>> - if (res == NULL) { ... \(goto l;\|return ret;\) }
>>    ... when != res
>> + res = platform_get_resource(pdev, IORESOURCE_MEM, n);
>>    e = devm_ioremap_resource(e1, res);
>> // </smpl>
>>
>> Signed-off-by: Julia Lawall <redacted>
>>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Acked-by: Wan Zongshun <redacted>

Thanks for your patch.

>
>



-- 
Wan ZongShun.
www.mcuos.com
```

## Re: \[PATCH 1/29\] pinctrl: nomadik: simplify use of devm\_ioremap\_resource

- From: Linus Walleij \<hidden\>
- Date: 2013-08-15 20:02:39 
- Message: https://ratatoskr.run/linux-arm-kernel/2013/08/4101624.md

```text
On Wed, Aug 14, 2013 at 11:11 AM, Julia Lawall [ref] wrote:

> From: Julia Lawall <redacted>
>
> Remove unneeded error handling on the result of a call to
> platform_get_resource when the value is passed to devm_ioremap_resource.
>
> Move the call to platform_get_resource adjacent to the call to
> devm_ioremap_resource to make the connection between them more clear.
>
> A simplified version of the semantic patch that makes this change is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression pdev,res,n,e,e1;
> expression ret != 0;
> identifier l;
> @@
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, n);
>   ... when != res
> - if (res == NULL) { ... \(goto l;\|return ret;\) }
>   ... when != res
> + res = platform_get_resource(pdev, IORESOURCE_MEM, n);
>   e = devm_ioremap_resource(e1, res);
> // </smpl>
>
> Signed-off-by: Julia Lawall <redacted>

Patch applied.

Yours,
Linus Walleij
```
