lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ