Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3948589rdg; Wed, 18 Oct 2023 10:15:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEYkZyCOLzedO3N7tK5Ubk50srflKEtjdahGOmErfNF0vT5BcqD5RnJhGKoU/oAhh1VjXL1 X-Received: by 2002:a17:902:e74b:b0:1c5:cbfb:c166 with SMTP id p11-20020a170902e74b00b001c5cbfbc166mr7286140plf.37.1697649339092; Wed, 18 Oct 2023 10:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697649339; cv=none; d=google.com; s=arc-20160816; b=Q2SAp2pJCifKfpsgdiwENb1J65NDaQ4AMNbOuHRftix5f1xQHXX+kbWIDm3MWawjFt gI0kuOLMIbEV6Fp2MowPAKAbNefB2sN8ynlEHXg80NR+quhYRCR/d5Qr9RPlhyQYHt47 MLg/KVUfaWb0sQWGme5sTvjJjT15sZgkbCXTyKYFDOi+c2dyijLHDHRw4oRbijkvRKyS rrlbfCfG0DKstv9XkFYdMpRj4ktQUeuzZqBhxzEDUhCRNMtJuDoYKCSHxRQjMCetCof8 jQ+2JsxOZR7JdMI2EfYwh5WYo5JafDePDE/qXD0C7HeoKa8u2qp4MYHrvgGQLfRXNBfD Hm+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=gztsOwGfcL76hyEG3OnrxJOIdYR+rNpC4AOAisaqul0=; fh=dNPvCZpkVz9amFhrD0H0s6NzRFAdQuGvM4jk8WyXWAA=; b=gfBLdjPDcnST6cwIU1xlLDbI72RVGgIHnB5FI29yjNcjHkhbn/+zUJaTxXmWdrVNw0 NLoiD4mukiFpinXQhSYPRW3lFq6ViMvTzvagpfPKZdVvhGGESBEskgvXAtdaizI1qOC/ 61ffCmlO9oRDaZRpmHSbKdGuH50isFXhF4EAO/H2zju3fjwvCObwjTU3hV5Exzn/H7LV tW5MNB0ihjmN8E9bz7enZDDCYMp3qdOa3KBkbnCtCZ3AcdQ3TGtVQ0hzcqMwTDgo5Ncw Zgy+DAIQm6q4DowIUQ8xDqy2ESoBuq2dIlNzLyDaZQphf1keIigBtXj+8WNpYjLN8y1o VbeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u11-20020a17090282cb00b001ca4dd7b834si284673plz.309.2023.10.18.10.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:15:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 39137820D5F1; Wed, 18 Oct 2023 10:15:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbjJRRPT (ORCPT + 99 others); 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 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 10:15:36 -0700 (PDT) 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 |