[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1f33bcd26589c3a2fd85c195837bdc52c6ec6492.camel@microchip.com>
Date: Fri, 26 Feb 2021 09:02:52 +0100
From: Steen Hegelund <steen.hegelund@...rochip.com>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>
CC: Philipp Zabel <p.zabel@...gutronix.de>,
Andrew Lunn <andrew@...n.ch>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
"Gregory Clement" <gregory.clement@...tlin.com>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v6 2/3] reset: mchp: sparx5: add switch reset driver
Hi Alex,
On Thu, 2021-02-25 at 21:40 +0100, Alexandre Belloni wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> Hello,
>
> >
...
> > +static int mchp_sparx5_map_io(struct platform_device *pdev, char
> > *name,
> > + struct regmap **target)
> > +{
> > + struct resource *res;
> > + struct regmap *map;
> > + void __iomem *mem;
> > +
> > + res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> > name);
> > + if (!res) {
> > + dev_err(&pdev->dev, "No '%s' resource\n", name);
> > + return -ENODEV;
> > + }
> > + mem = devm_ioremap(&pdev->dev, res->start, res->end - res-
> > >start + 1);
> > + if (!mem) {
> > + dev_err(&pdev->dev, "Could not map '%s' resource\n",
> > name);
> > + return -ENXIO;
> > + }
>
> Someone is going to tell you to use
> devm_platform_get_and_ioremap_resource so it may as well be me ;)
Very nice.
Thanks for the info. I will use that instead.
>
> --
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
--
BR
Steen
-=-=-=-=-=-=-=-=-=-=-=-=-=-=
steen.hegelund@...rochip.com
Powered by blists - more mailing lists