From: "Alexander Shiyan" <shc_work@mail.ru>
To: "Peter Ujfalusi" <peter.ujfalusi@ti.com>
Cc: "Santosh Shilimkar" <santosh.shilimkar@ti.com>,
"Tony Lindgren" <tony@atomide.com>,
"Olof Johansson" <olof@lixom.net>,
linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
"Arnd Bergmann" <arnd@arndb.de>,
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:12:39 +0400 [thread overview]
Message-ID: <1393924359.866301359@f148.i.mail.ru> (raw)
In-Reply-To: <1393923710-10377-3-git-send-email-peter.ujfalusi@ti.com>
Вторник, 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]))
> + dev_err(&pdev->dev, "ioremap %d failed\n", i);
Unnecessary.
> + return -ENOMEM;
return PTR_ERR(l3->l3_base[i]);
---
next prev parent reply other threads:[~2014-03-04 9:12 UTC|newest]
Thread overview: 13+ 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 [this message]
2014-03-04 9:23 ` Alexander Shiyan
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
-- strict thread matches above, loose matches on Subject: below --
2013-05-02 12:09 [PATCH 0/5] drivers: bus: omap_l3: Conversion to devm_* Peter Ujfalusi
2013-05-02 12:09 ` [PATCH 2/5] drivers: bus: omap_l3: Convert to use devm_request_and_ioremap() 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=1393924359.866301359@f148.i.mail.ru \
--to=shc_work@mail.ru \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=olof@lixom.net \
--cc=peter.ujfalusi@ti.com \
--cc=santosh.shilimkar@ti.com \
--cc=tony@atomide.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