From: ezequiel.garcia@free-electrons.com (Ezequiel Garcia)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] net: mvneta: use devm_ioremap_resource() instead of of_iomap()
Date: Tue, 25 Mar 2014 20:34:24 -0300 [thread overview]
Message-ID: <20140325233424.GA14158@arch.cereza> (raw)
In-Reply-To: <1395790015-20929-1-git-send-email-thomas.petazzoni@free-electrons.com>
On Mar 26, Thomas Petazzoni wrote:
[..]
> @@ -2774,6 +2775,7 @@ static void mvneta_port_power_up(struct mvneta_port *pp, int phy_mode)
> static int mvneta_probe(struct platform_device *pdev)
> {
> const struct mbus_dram_target_info *dram_target_info;
> + struct resource *res;
> struct device_node *dn = pdev->dev.of_node;
> struct device_node *phy_node;
> u32 phy_addr;
> @@ -2838,9 +2840,15 @@ static int mvneta_probe(struct platform_device *pdev)
>
> clk_prepare_enable(pp->clk);
>
> - pp->base = of_iomap(dn, 0);
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res) {
> + err = -ENODEV;
> + goto err_clk;
> + }
> +
> + pp->base = devm_ioremap_resource(&pdev->dev, res);
When you use devm_ioremap_resource, you don't need to have error handling
in platform_get_resource. Take a look at the comment at lib/devres.c.
--
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
prev parent reply other threads:[~2014-03-25 23:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 23:26 [PATCH] net: mvneta: use devm_ioremap_resource() instead of of_iomap() Thomas Petazzoni
2014-03-25 23:34 ` Ezequiel Garcia [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=20140325233424.GA14158@arch.cereza \
--to=ezequiel.garcia@free-electrons.com \
--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