linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] replace devm_request_and_ioremap by devm_ioremap_resource
@ 2013-08-19 11:20 Julia Lawall
  2013-08-19 11:20 ` [PATCH 6/7] video: xilinxfb: " Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: linux-arm-kernel

devm_request_and_ioremap has been replaced by devm_ioremap_resource, which
gives more informative error return code information.  This patch series
removes the remaining uses of devm_request_and_ioremap.

This patch series was generated using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci from the Linux kernel
source tree.  Manual modifications have been made to move associated calls
to platform_get_resource closer to the resulting call to
devm_ioremap_resource and to remove the associated error handling code.


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

* [PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20 [PATCH 0/7] replace devm_request_and_ioremap by devm_ioremap_resource Julia Lawall
@ 2013-08-19 11:20 ` Julia Lawall
  2013-08-30  9:42   ` Tomi Valkeinen
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2013-08-19 11:20 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard
  Cc: kernel-janitors, Tomi Valkeinen, linux-fbdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The initialization of drvdata->regs_phys was manually moved lower, to take
advantage of the NULL test on res performed by devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/video/xilinxfb.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 6629b29..84c664e 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev,
 		struct resource *res;
 
 		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		drvdata->regs_phys = res->start;
-		drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
-		if (!drvdata->regs) {
-			rc = -EADDRNOTAVAIL;
+		drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
+		if (IS_ERR(drvdata->regs)) {
+			rc = PTR_ERR(drvdata->regs);
 			goto err_region;
 		}
+		drvdata->regs_phys = res->start;
 	}
 
 	/* Allocate the framebuffer memory */


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

* Re: [PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource
  2013-08-19 11:20 ` [PATCH 6/7] video: xilinxfb: " Julia Lawall
@ 2013-08-30  9:42   ` Tomi Valkeinen
  0 siblings, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2013-08-30  9:42 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jean-Christophe Plagniol-Villard, kernel-janitors, linux-fbdev,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1386 bytes --]

On 19/08/13 14:20, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Use devm_ioremap_resource instead of devm_request_and_ioremap.
> 
> This was done using the semantic patch
> scripts/coccinelle/api/devm_ioremap_resource.cocci
> 
> The initialization of drvdata->regs_phys was manually moved lower, to take
> advantage of the NULL test on res performed by devm_ioremap_resource.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/video/xilinxfb.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
> index 6629b29..84c664e 100644
> --- a/drivers/video/xilinxfb.c
> +++ b/drivers/video/xilinxfb.c
> @@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev,
>  		struct resource *res;
>  
>  		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -		drvdata->regs_phys = res->start;
> -		drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
> -		if (!drvdata->regs) {
> -			rc = -EADDRNOTAVAIL;
> +		drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
> +		if (IS_ERR(drvdata->regs)) {
> +			rc = PTR_ERR(drvdata->regs);
>  			goto err_region;
>  		}
> +		drvdata->regs_phys = res->start;
>  	}
>  
>  	/* Allocate the framebuffer memory */

Thanks, queued for 3.12.

 Tomi




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

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

end of thread, other threads:[~2013-08-30  9:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-19 11:20 [PATCH 0/7] replace devm_request_and_ioremap by devm_ioremap_resource Julia Lawall
2013-08-19 11:20 ` [PATCH 6/7] video: xilinxfb: " Julia Lawall
2013-08-30  9:42   ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).