[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VeP_+2wJUyMThNs6_AbbbVa8qV6KrLDbXD5BYiOkp13qg@mail.gmail.com>
Date: Wed, 17 Jun 2020 20:54:23 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Russell King - ARM Linux admin <linux@...linux.org.uk>
Cc: Calvin Johnson <calvin.johnson@....nxp.com>,
Jeremy Linton <jeremy.linton@....com>, Jon <jon@...id-run.com>,
Cristi Sovaiala <cristian.sovaiala@....com>,
Ioana Ciornei <ioana.ciornei@....com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Madalin Bucur <madalin.bucur@....nxp.com>,
netdev <netdev@...r.kernel.org>, linux.cj@...il.com
Subject: Re: [PATCH v1 2/3] net/fsl: acpize xgmac_mdio
On Wed, Jun 17, 2020 at 8:49 PM Russell King - ARM Linux admin
<linux@...linux.org.uk> wrote:
> On Wed, Jun 17, 2020 at 10:45:34PM +0530, Calvin Johnson wrote:
...
> > - ret = of_address_to_resource(np, 0, &res);
> > - if (ret) {
> > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > + if (!res) {
> > dev_err(&pdev->dev, "could not obtain address\n");
> > - return ret;
> > + return -EINVAL;
> > }
>
> I think, as you're completely rewriting the resource handling, it would
> be a good idea to switch over to using devm_* stuff here.
>
> void __iomem *regs;
>
> regs = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(regs))
{
> dev_err(&pdev->dev, "could not map resource: %pe\n",
> regs);
And just in case, this message is dup. The API has few of them
depending on the error conditions.
> return PTR_ERR(regs);
> }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists