public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steen Hegelund <steen.hegelund@microchip.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
	Andrew Lunn <andrew@lunn.ch>,
	Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
	"Gregory Clement" <gregory.clement@bootlin.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v6 2/3] reset: mchp: sparx5: add switch reset driver
Date: Fri, 26 Feb 2021 09:02:52 +0100	[thread overview]
Message-ID: <1f33bcd26589c3a2fd85c195837bdc52c6ec6492.camel@microchip.com> (raw)
In-Reply-To: <YDgLTczzqTBCwEUY@piout.net>

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@microchip.com


  reply	other threads:[~2021-02-26  8:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  9:50 [PATCH v6 0/3] Adding the Sparx5 Switch Reset Driver Steen Hegelund
2021-02-25  9:50 ` [PATCH v6 1/3] dt-bindings: reset: microchip sparx5 reset driver bindings Steen Hegelund
2021-02-25  9:50 ` [PATCH v6 2/3] reset: mchp: sparx5: add switch reset driver Steen Hegelund
2021-02-25 20:40   ` Alexandre Belloni
2021-02-26  8:02     ` Steen Hegelund [this message]
2021-02-25  9:50 ` [PATCH v6 3/3] arm64: dts: reset: add microchip sparx5 " Steen Hegelund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f33bcd26589c3a2fd85c195837bdc52c6ec6492.camel@microchip.com \
    --to=steen.hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=gregory.clement@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox