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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1D4CCDB47E for ; Wed, 18 Oct 2023 17:15:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230118AbjJRRPT (ORCPT ); Wed, 18 Oct 2023 13:15:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbjJRRPS (ORCPT ); Wed, 18 Oct 2023 13:15:18 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B39A2111 for ; Wed, 18 Oct 2023 10:15:13 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qtA83-0004b7-5u; Wed, 18 Oct 2023 19:14:43 +0200 Received: from [2a0a:edc0:2:b01:1d::c0] (helo=ptx.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtA81-002bcg-7A; Wed, 18 Oct 2023 19:14:41 +0200 Received: from ore by ptx.whiteo.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1qtA81-00F8qS-46; Wed, 18 Oct 2023 19:14:41 +0200 Date: Wed, 18 Oct 2023 19:14:41 +0200 From: Oleksij Rempel To: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh , Arun Ramadoss , Conor Dooley , Krzysztof Kozlowski , Rob Herring Cc: Florian Fainelli , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, "Russell King (Oracle)" , devicetree@vger.kernel.org Subject: Re: [PATCH net-next v5 8/9] net: dsa: microchip: Refactor switch shutdown routine for WoL preparation Message-ID: <20231018171441.GB3595737@pengutronix.de> References: <20231018113913.3629151-1-o.rempel@pengutronix.de> <20231018113913.3629151-9-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231018113913.3629151-9-o.rempel@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 18, 2023 at 01:39:12PM +0200, Oleksij Rempel wrote: > Centralize the switch shutdown routine in a dedicated function, > ksz_switch_shutdown(), to enhance code maintainability and reduce > redundancy. This change abstracts the common shutdown operations > previously duplicated in ksz9477_i2c_shutdown() and ksz_spi_shutdown(). > > This refactoring is a preparatory step for an upcoming patch to avoid > reset on shutdown if Wake-on-LAN (WoL) is enabled. > > Signed-off-by: Oleksij Rempel > Reviewed-by: Florian Fainelli > --- ... > EXPORT_SYMBOL(ksz_switch_alloc); > > +/** > + * ksz_switch_shutdown - Shutdown routine for the switch device. > + * @dev: The switch device structure. > + * > + * This function is responsible for initiating a shutdown sequence for the > + * switch device. It invokes the reset operation defined in the device > + * operations, if available, to reset the switch. Subsequently, it calls the > + * DSA framework's shutdown function to ensure a proper shutdown of the DSA > + * switch. > + */ > +void ksz_switch_shutdown(struct ksz_device *dev) > +{ > + if (dev->dev_ops->reset) > + dev->dev_ops->reset(dev); > + > + dsa_switch_shutdown(dev->ds); > +} here is missing EXPORT_SYMBOL(ksz_switch_shutdown); -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |