linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: EDMA: Use platform_get_resource functions for DT
Date: Fri, 21 Feb 2014 13:24:16 +0000	[thread overview]
Message-ID: <20140221132416.GS27282@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1392956661-28787-1-git-send-email-joelf@ti.com>

On Thu, Feb 20, 2014 at 10:24:21PM -0600, Joel Fernandes wrote:
> diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
> index dc95efc..ae0ccae 100644
> --- a/arch/arm/common/edma.c
> +++ b/arch/arm/common/edma.c
> @@ -1469,11 +1470,14 @@ static int edma_xbar_event_map(struct device *dev,
>  	if (!xbar_chans)
>  		return -ENOMEM;
>  
> -	ret = of_address_to_resource(node, 1, &res);
> -	if (ret)
> +	pdev = to_platform_device(dev);
> +	res = platform_get_resource_byname(pdev,
> +					   IORESOURCE_MEM,
> +					   "edma_xbar");
> +	if (!res)
>  		return -EIO;
>  
> -	xbar = devm_ioremap(dev, res.start, resource_size(&res));
> +	xbar = devm_ioremap(dev, res->start, resource_size(res));
>  	if (!xbar)
>  		return -ENOMEM;

Irrespective of what Mark said, this should be upgraded to use
devm_ioremap_resource() which does all the checking necessary (and
claims the resource.)  That can be done irrespective of this change.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

      parent reply	other threads:[~2014-02-21 13:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21  4:24 [PATCH] ARM: EDMA: Use platform_get_resource functions for DT Joel Fernandes
2014-02-21 12:15 ` Mark Rutland
2014-02-21 17:36   ` Joel Fernandes
2014-02-25 16:22     ` Rob Herring
2014-02-25 16:42       ` Joel Fernandes
2014-02-21 13:24 ` Russell King - ARM Linux [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=20140221132416.GS27282@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).