linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shc_work@mail.ru (Alexander Shiyan)
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/5] drivers: bus: omap_l3: Convert to use devm_request_and_ioremap()
Date: Tue, 04 Mar 2014 13:23:20 +0400	[thread overview]
Message-ID: <1393925000.716948505@f148.i.mail.ru> (raw)
In-Reply-To: <1393924359.866301359@f148.i.mail.ru>

???????,  4 ????? 2014, 13:12 +04:00 ?? Alexander Shiyan <shc_work@mail.ru>:
> ???????,  4 ????? 2014, 11:01 +02:00 ?? Peter Ujfalusi <peter.ujfalusi@ti.com>:
> > We can then remove the iounmap() calls from probe and remove.
> > Since the driver requests the resources via index we can do the mem resource
> > request within a for loop.
> > 
> > Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> > Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti>
> > ---
> 
> > +	/* Get mem resources */
> > +	for (i = 0; i < 3; i++) {
> > +		struct resource	*res = platform_get_resource(pdev,
> > +							     IORESOURCE_MEM, i);
> > +		if (!res) {
> > +			dev_err(&pdev->dev, "couldn't find resource %d\n", i);
> > +			return -ENODEV;
> > +		}
> 
> No need to check "res". devm_request_and_ioremap() do all for us.
> 
> > -	l3->l3_base[2] = ioremap(res->start, resource_size(res));
> > -	if (!l3->l3_base[2]) {
> > -		dev_err(&pdev->dev, "ioremap failed\n");
> > -		ret = -ENOMEM;
> > -		goto err2;
> > +		l3->l3_base[i] = devm_request_and_ioremap(&pdev->dev, res);
> > +		if (!l3->l3_base[i]) {
> 
> if (IS_ERR(l3->l3_base[i]))

Ahh, I messed up this with devm_ioremap_resource().
However, if there is reason to use devm_request_and_ioremap() here?

---

  reply	other threads:[~2014-03-04  9:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04  9:01 [PATCH 0/5] drivers: bus: omap_l3: Conversion to devm_* Peter Ujfalusi
2014-03-04  9:01 ` [PATCH 1/5] drivers: bus: omap_l3: Convert to use devm_kzalloc Peter Ujfalusi
2014-03-04  9:07   ` Peter Ujfalusi
2014-03-04  9:01 ` [PATCH 2/5] drivers: bus: omap_l3: Convert to use devm_request_and_ioremap() Peter Ujfalusi
2014-03-04  9:12   ` Alexander Shiyan
2014-03-04  9:23     ` Alexander Shiyan [this message]
2014-03-04  9:42       ` Peter Ujfalusi
2014-03-04  9:42     ` Peter Ujfalusi
2014-03-04 10:50     ` Peter Ujfalusi
2014-03-04  9:01 ` [PATCH 3/5] drivers: bus: omap_l3: Convert to use devm_request_irq() Peter Ujfalusi
2014-03-04  9:01 ` [PATCH 4/5] drivers: bus: omap_l3: Remove the platform driver's remove function Peter Ujfalusi
2014-03-04  9:01 ` [PATCH 5/5] drivers: bus: omap_l3: Change pr_crit() to dev_err() when IRQ request fails Peter Ujfalusi

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=1393925000.716948505@f148.i.mail.ru \
    --to=shc_work@mail.ru \
    --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).