From patchwork Tue Dec 10 14:18:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13901521 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0C8BE7717F for ; Tue, 10 Dec 2024 14:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:Content-Type :Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=heuIwIaco0ryk9+s/3Tq5BiUJ5G/QcaQOBK21igxZiY=; b=I5ceLJAa7UcZpI/W7FDua4xZLg JXKkziLQSJlykbdOrYc4COJJ96jmfhT1EMQK1xFkDekTJ7ZKPkTxM/PvhcpmEOIz1LHDKpjdATG9b vBhQqkYLHo50/ByO5rJHN6sV7XdroVUAHdRfEAayOYclVpgDjSZAOhX3DqtuIj3g6NUgbPrC3Wk8Q 8nviQqV7zqUMAPiF8+KqI+4Y2/514Xxvpunvtrb+nVLUHBbhm+n3tS0OWKDojyHBpf+Ht07B22tay 8OhjcNj8fCF94k/43n8rVydQVqFyyT83bvWHOivYrexx5hcLKoPkbMBUcXah4AntA+IaBWffL7SzH BK17tQtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tL1Hi-0000000Bm3e-3Ogr; Tue, 10 Dec 2024 14:32:22 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tL14D-0000000BilT-0AQl; Tue, 10 Dec 2024 14:18:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=heuIwIaco0ryk9+s/3Tq5BiUJ5G/QcaQOBK21igxZiY=; b=XFfBQAqncOi6+bZnJUa8u14GfE UH8WBg+i6wqTKWI8CHNHcSbcGTpgqfjaXailak5EzFeS96sihLJ4ldTDUs2ELiuRgSJmULcN9MHzi JzA6UCRt5thLH1p17CcvY6BQn/ITnlPDxkb25ziGJDZ0aPCrJTRmvLEvs3gz1jPbX076UP1hfhh8Z pxK29YsRBn34S71NiQIxMRLk9kVB0PaqRfJrc6PBhgwUEMqPTI5RPTn1RQhmEnE5M+MlCVAEyYB5W xql3R6UiD2YWN1pCm6XOY1K5hlhZ6yaT7TstmWzy+wt6p9fn8DMVhQ4J/MzmLcw2vPG5EWvwSKW65 yhKcAAjg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:38238 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tL140-0002Sc-2g; Tue, 10 Dec 2024 14:18:13 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tL13z-006cZ7-BZ; Tue, 10 Dec 2024 14:18:11 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: AngeloGioacchino Del Regno , "Ar__n__ __NAL" , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , Simon Horman , UNGLinuxDriver@microchip.com, Vladimir Oltean , Woojung Huh Subject: [PATCH net-next 1/9] net: dsa: remove check for dp->pl in EEE methods MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 10 Dec 2024 14:18:11 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_061825_084063_3ABCEE6A X-CRM114-Status: GOOD ( 12.04 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org When user ports are initialised, a phylink instance is always created, and so dp->pl will always be non-NULL. The EEE methods are only used for user ports, so checking for dp->pl to be NULL makes no sense. No other phylink-calling method implements similar checks in DSA. Remove this unnecessary check. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli --- net/dsa/user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/dsa/user.c b/net/dsa/user.c index 06c30a9e29ff..0640247b8f0a 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -1229,7 +1229,7 @@ static int dsa_user_set_eee(struct net_device *dev, struct ethtool_keee *e) int ret; /* Port's PHY and MAC both need to be EEE capable */ - if (!dev->phydev || !dp->pl) + if (!dev->phydev) return -ENODEV; if (!ds->ops->set_mac_eee) @@ -1249,7 +1249,7 @@ static int dsa_user_get_eee(struct net_device *dev, struct ethtool_keee *e) int ret; /* Port's PHY and MAC both need to be EEE capable */ - if (!dev->phydev || !dp->pl) + if (!dev->phydev) return -ENODEV; if (!ds->ops->get_mac_eee)