From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out28-195.mail.aliyun.com (out28-195.mail.aliyun.com [115.124.28.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 117C4378D8C; Tue, 29 Sep 2026 02:54:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.28.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790650487; cv=none; b=OwyGZaZVmq7Gtvv+j9joMJjPRfjekUa0zd0mIIlwOE+6ozTj3laJa5bo++/dcsSSlJ66hHGkdh8dBlnszTLjEoxcNaTMAVOL1vO3a2feVwyOzBR5rgX011QHNGXl++p21WBzSGrhO33vaNgIR6sfq8B+/xUjps9aarYk6e89h9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790650487; c=relaxed/simple; bh=Or3xnQhquSLUrI4Vmnn9kRa9c2PML7hfcBy5kMF06do=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kZBZmr7c9dSuVaCCJpOr20qaEiqfvC/wsizmO+GmRXSh+83bho1HjgpaJ2KYApkoN1z1FE/egMoCcT1xjp2PjukdgtiKegmkcckSRAJDzoX3IM4HYNW46KZFIPrb93Gs0psWFk0IxuajM5vEVfCsAviR6szjn4aGESq9ijByEWY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=motor-comm.com; spf=pass smtp.mailfrom=motor-comm.com; arc=none smtp.client-ip=115.124.28.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=motor-comm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=motor-comm.com X-Alimail-AntiSpam:AC=CONTINUE;BC=0.1537959|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.204836-0.00141997-0.793744;FP=9472783458238115456|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033037006180;MF=kyle.switch@motor-comm.com;NM=1;PH=DS;RN=16;RT=16;SR=0;TI=SMTPD_---.jQghbv9_1790650470; Received: from motor-comm.com(mailfrom:kyle.switch@motor-comm.com fp:SMTPD_---.jQghbv9_1790650470 cluster:ay29) by smtp.aliyun-inc.com; Tue, 29 Sep 2026 10:54:30 +0800 From: Kyle Switch To: andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mmyangfl@gmail.com, horms@kernel.org, linux@armlinux.org.uk, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ming.xu@motor-comm.com, xiaolin.xu@motor-comm.com, jianmin.wang@motor-comm.com, wei.zhang@gl-inet.com, sijia.huang@gl-inet.com Subject: [PATCH net-next v10 5/7] net: dsa: motorcomm: move mib stop from remove() to teardown() Date: Tue, 29 Sep 2026 10:54:12 +0800 Message-Id: <20260929025414.313641-7-kyle.switch@motor-comm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260929025414.313641-1-kyle.switch@motor-comm.com> References: <20260929025414.313641-1-kyle.switch@motor-comm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This change ensures symmetry with the MIB start operation, which is already invoked in the setup(). Additionally, it consolidates per-switch operation into the appropriate DSA ops, improving code organization and maintainability. Signed-off-by: Kyle Switch --- drivers/net/dsa/motorcomm/chip.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c index c7cfaf244274..9380d74d79ba 100644 --- a/drivers/net/dsa/motorcomm/chip.c +++ b/drivers/net/dsa/motorcomm/chip.c @@ -3924,6 +3924,12 @@ static void yt921x_dsa_teardown(struct dsa_switch *ds) yt921x_leds_remove(priv); #endif + + for (size_t i = ARRAY_SIZE(priv->ports); i-- > 0; ) { + struct yt921x_port *pp = &priv->ports[i]; + + disable_delayed_work_sync(&pp->mib_read); + } } static int yt921x_chip_detect(struct yt921x_priv *priv) @@ -4483,12 +4489,6 @@ static void yt921x_mdio_remove(struct mdio_device *mdiodev) if (!priv) return; - for (size_t i = ARRAY_SIZE(priv->ports); i-- > 0; ) { - struct yt921x_port *pp = &priv->ports[i]; - - disable_delayed_work_sync(&pp->mib_read); - } - dsa_unregister_switch(&priv->ds); for (unsigned int i = 0; i < ARRAY_SIZE(priv->acl_blks); i++) { -- 2.25.1