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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50e1ec4d-818c-45a8-875b-40f74cca1514@gmail.com>
Date: Tue, 3 Dec 2024 23:27:20 +0100
From: Heiner Kallweit <hkallweit1@...il.com>
To: Rosen Penev <rosenp@...il.com>, netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>, ansuelsmth@...il.com,
 Russell King <linux@...linux.org.uk>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 1/2] net: mdio-ipq8064: use platform_get_resource

On 03.12.2024 23:16, Rosen Penev wrote:
> There's no need to get the of_node explicitly. platform_get_resource
> already does this.
> 
> Signed-off-by: Rosen Penev <rosenp@...il.com>
> ---
>  drivers/net/mdio/mdio-ipq8064.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mdio/mdio-ipq8064.c b/drivers/net/mdio/mdio-ipq8064.c
> index 6253a9ab8b69..e3d311ce3810 100644
> --- a/drivers/net/mdio/mdio-ipq8064.c
> +++ b/drivers/net/mdio/mdio-ipq8064.c
> @@ -111,15 +111,16 @@ ipq8064_mdio_probe(struct platform_device *pdev)
>  {
>  	struct device_node *np = pdev->dev.of_node;
>  	struct ipq8064_mdio *priv;
> -	struct resource res;
> +	struct resource *res;
>  	struct mii_bus *bus;
>  	void __iomem *base;
>  	int ret;
>  
> -	if (of_address_to_resource(np, 0, &res))
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!res)
>  		return -ENOMEM;
>  
> -	base = devm_ioremap(&pdev->dev, res.start, resource_size(&res));
> +	base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
>  	if (!base)
>  		return -ENOMEM;
>  

Why not directly switching to devm_platform_get_and_ioremap_resource()?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ