[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKxU2N_D1vjhfdX=ou2S+rfabe5nM9i=Q6YYYigLJMN3t9JS0g@mail.gmail.com>
Date: Tue, 3 Dec 2024 14:32:26 -0800
From: Rosen Penev <rosenp@...il.com>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: netdev@...r.kernel.org, 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 Tue, Dec 3, 2024 at 2:27 PM Heiner Kallweit <hkallweit1@...il.com> wrote:
>
> 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()?
Because that is not the same.
devm_platform_get_and_ioremap_resource is
platform_get_resource + request_memory_region + ioremap
The issue here is the second. This driver (well, platform really) uses
overlapping memory regions and so request_memory_region will fail.
Powered by blists - more mailing lists