From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19FD8C07E94 for ; Fri, 4 Jun 2021 09:28:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 018D061411 for ; Fri, 4 Jun 2021 09:28:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbhFDJaK convert rfc822-to-8bit (ORCPT ); Fri, 4 Jun 2021 05:30:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbhFDJaK (ORCPT ); Fri, 4 Jun 2021 05:30:10 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C87EC06174A for ; Fri, 4 Jun 2021 02:28:24 -0700 (PDT) Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lp67c-0000gP-SO; Fri, 04 Jun 2021 11:28:08 +0200 Received: from pza by lupine with local (Exim 4.92) (envelope-from ) id 1lp67a-0004yy-3y; Fri, 04 Jun 2021 11:28:06 +0200 Message-ID: <6a1500fb623e6513e39a468ac53d1caf6a2cf7c5.camel@pengutronix.de> Subject: Re: [PATCH net-next v3 02/10] net: sparx5: add the basic sparx5 driver From: Philipp Zabel To: Steen Hegelund , "David S. Miller" , Jakub Kicinski Cc: Andrew Lunn , Russell King , Microchip Linux Driver Support , Alexandre Belloni , Madalin Bucur , Mark Einon , Masahiro Yamada , Arnd Bergmann , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bjarni Jonasson , Lars Povlsen Date: Fri, 04 Jun 2021 11:28:06 +0200 In-Reply-To: <20210604085600.3014532-3-steen.hegelund@microchip.com> References: <20210604085600.3014532-1-steen.hegelund@microchip.com> <20210604085600.3014532-3-steen.hegelund@microchip.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 > Signed-off-by: Bjarni Jonasson > Signed-off-by: Lars Povlsen > --- > 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. > + 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. regards Philipp