From: Steen Hegelund <steen.hegelund@microchip.com>
To: Philipp Zabel <p.zabel@pengutronix.de>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
Russell King <linux@armlinux.org.uk>,
Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
Madalin Bucur <madalin.bucur@oss.nxp.com>,
Mark Einon <mark.einon@gmail.com>,
"Masahiro Yamada" <masahiroy@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Simon Horman <simon.horman@netronome.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
Bjarni Jonasson <bjarni.jonasson@microchip.com>,
Lars Povlsen <lars.povlsen@microchip.com>
Subject: Re: [PATCH net-next v3 02/10] net: sparx5: add the basic sparx5 driver
Date: Mon, 7 Jun 2021 09:34:20 +0200 [thread overview]
Message-ID: <b215ecea90794688906fb0a6d34636e1e8c1fc3e.camel@microchip.com> (raw)
In-Reply-To: <6a1500fb623e6513e39a468ac53d1caf6a2cf7c5.camel@pengutronix.de>
Hi Philipp,
Thanks for your comments.
On Fri, 2021-06-04 at 11:28 +0200, Philipp Zabel wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> Hi Steen,
>
> On Fri, 2021-06-04 at 10:55 +0200, Steen Hegelund wrote:
> > This adds the Sparx5 basic SwitchDev driver framework with IO range
> > mapping, switch device detection and core clock configuration.
> >
> > Support for ports, phylink, netdev, mactable etc. are in the following
> > patches.
> >
> > Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
> > Signed-off-by: Bjarni Jonasson <bjarni.jonasson@microchip.com>
> > Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
> > ---
> > drivers/net/ethernet/microchip/Kconfig | 2 +
> > drivers/net/ethernet/microchip/Makefile | 2 +
> > drivers/net/ethernet/microchip/sparx5/Kconfig | 9 +
> > .../net/ethernet/microchip/sparx5/Makefile | 8 +
> > .../ethernet/microchip/sparx5/sparx5_main.c | 746 +++
> > .../ethernet/microchip/sparx5/sparx5_main.h | 273 +
> > .../microchip/sparx5/sparx5_main_regs.h | 4642 +++++++++++++++++
> > 7 files changed, 5682 insertions(+)
> > create mode 100644 drivers/net/ethernet/microchip/sparx5/Kconfig
> > create mode 100644 drivers/net/ethernet/microchip/sparx5/Makefile
> > create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> > create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_main.h
> > create mode 100644 drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h
> >
> [...]
> > diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> > b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> > new file mode 100644
> > index 000000000000..73beb85bc52d
> > --- /dev/null
> > +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> > @@ -0,0 +1,746 @@
> [...]
> > +static int mchp_sparx5_probe(struct platform_device *pdev)
> > +{
> [...]
> > +
> > + sparx5->reset = devm_reset_control_get_shared(&pdev->dev, "switch");
> > + if (IS_ERR(sparx5->reset)) {
>
> Could you use devm_reset_control_get_optional_shared() instead of
> ignoring this error? That would just return NULL if there's no "switch"
> reset specified in the device tree.
Yes. That sounds like a good idea. I assume that the devm_reset_control_get_optional_shared()
would also return null if another driver has already performed the reset?
>
> > + dev_warn(sparx5->dev, "Could not obtain reset control: %ld\n",
> > + PTR_ERR(sparx5->reset));
> > + sparx5->reset = NULL;
> > + } else {
> > + reset_control_reset(sparx5->reset);
> > + }
>
> If this is the only place the reset is used, I'd remove it from struct
> sparx5 and use a local variable instead.
Yes. I will do that.
>
> regards
> Philipp
Best
--
BR
Steen
-=-=-=-=-=-=-=-=-=-=-=-=-=-=
steen.hegelund@microchip.com
next prev parent reply other threads:[~2021-06-07 7:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 8:55 [PATCH net-next v3 00/10] Adding the Sparx5 Switch Driver Steen Hegelund
2021-06-04 8:55 ` [PATCH net-next v3 01/10] dt-bindings: net: sparx5: Add sparx5-switch bindings Steen Hegelund
2021-06-04 8:55 ` [PATCH net-next v3 02/10] net: sparx5: add the basic sparx5 driver Steen Hegelund
2021-06-04 9:28 ` Philipp Zabel
2021-06-07 7:34 ` Steen Hegelund [this message]
2021-06-07 8:13 ` Philipp Zabel
2021-06-04 8:55 ` [PATCH net-next v3 03/10] net: sparx5: add hostmode with phylink support Steen Hegelund
2021-06-07 9:15 ` Russell King (Oracle)
2021-06-07 12:45 ` Steen Hegelund
2021-06-07 13:09 ` Russell King (Oracle)
2021-06-07 15:12 ` Steen Hegelund
2021-06-07 15:35 ` Russell King (Oracle)
2021-06-08 9:24 ` Steen Hegelund
2021-06-04 8:55 ` [PATCH net-next v3 04/10] net: sparx5: add port module support Steen Hegelund
2021-06-07 9:21 ` Russell King (Oracle)
2021-06-07 12:46 ` Steen Hegelund
2021-06-07 13:12 ` Russell King (Oracle)
2021-06-07 15:14 ` Steen Hegelund
2021-06-04 8:55 ` [PATCH net-next v3 05/10] net: sparx5: add mactable support Steen Hegelund
2021-06-04 8:55 ` [PATCH net-next v3 06/10] net: sparx5: add vlan support Steen Hegelund
2021-06-04 8:55 ` [PATCH net-next v3 07/10] net: sparx5: add switching support Steen Hegelund
2021-06-04 8:55 ` [PATCH net-next v3 08/10] net: sparx5: add calendar bandwidth allocation support Steen Hegelund
2021-06-04 8:55 ` [PATCH net-next v3 09/10] net: sparx5: add ethtool configuration and statistics support Steen Hegelund
2021-06-04 8:56 ` [PATCH net-next v3 10/10] arm64: dts: sparx5: Add the Sparx5 switch node 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=b215ecea90794688906fb0a6d34636e1e8c1fc3e.camel@microchip.com \
--to=steen.hegelund@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=bjarni.jonasson@microchip.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=lars.povlsen@microchip.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=madalin.bucur@oss.nxp.com \
--cc=mark.einon@gmail.com \
--cc=masahiroy@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=simon.horman@netronome.com \
/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;
as well as URLs for NNTP newsgroup(s).