linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	kernel-janitors@vger.kernel.org, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource
Date: Fri, 30 Aug 2013 09:42:27 +0000	[thread overview]
Message-ID: <52206903.5050707@ti.com> (raw)
In-Reply-To: <1376911241-27720-7-git-send-email-Julia.Lawall@lip6.fr>

[-- 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 --]

      reply	other threads:[~2013-08-30  9:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52206903.5050707@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).