[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140325233424.GA14158@arch.cereza>
Date: Tue, 25 Mar 2014 20:34:24 -0300
From: Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>
To: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
Cc: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Gregory Clement <gregory.clement@...e-electrons.com>,
Lior Amsalem <alior@...vell.com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] net: mvneta: use devm_ioremap_resource() instead of
of_iomap()
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists