From nobody Mon Feb 9 15:26:31 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 155253939D5 for ; Thu, 5 Feb 2026 09:23:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770283422; cv=none; b=cVw5NM9qeuO5QJ72qAR0uT68e2Nwurw6cXaCNWER0G2HC/RwiAd86LuJTlWz3B7M34/ok+S6n+YmEGJLBvXHAm4W6NvcG0TDBgBfqsN/IC4KVKY2j6OoEIaT8QQ4bvjNLrAywWWLz+TwRcCqxosoyDXVXpmJIw2eynvgxKAVh90= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770283422; c=relaxed/simple; bh=mWyMx4Wb/HCw51vDYbHGsY4S6C9v30+HtBdi1q1SCSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mOXc9jXuuEPikqz773RKQnbUF8dV7mH+nLMnFXmOXikdkxVgyIvcL8yQ4jGde8Aa5s0Bv+hQB5gOgb7jQioDOtxZzvLSIy7BLKtTiPCYtCtRIyWP0rLnqYlrgq/e+gT7OsY34ZYK0BJZWccN0MeKKRQPWv2amhVyCbMaeFN2fAE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=LrnRRMgk; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="LrnRRMgk" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 8ACDE1A2C1C; Thu, 5 Feb 2026 09:23:40 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 60D4D606FD; Thu, 5 Feb 2026 09:23:40 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 12E66119A88EE; Thu, 5 Feb 2026 10:23:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1770283418; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=KecJRPe2Bv70TIJpdknGkVxhofD7qopvizBIlkrUTDs=; b=LrnRRMgkbQJF7Am5qND1WcrHoeGfJnm0S5TpuJAoalZ9D17tQ3TU2q2VC9/jlFN19JgYNM 0aH6groa+FXi+jcxzsgR4sXaUwzNDFn036DLviycVf1ON44Vby3Hqg738778ja4jj9pu8e 7V0UdZK++BWy55dJUdvBxHuhyMHSd5cY4xWN5bW8HVSuqbhRVB2QKx3Qciqe6sIQ6mBxBX dOYJEncGL+kjt97q08eGs1hUNy8lz+CtsGd9VopqeWnLoglf30bwxOSbOBY9vkE/0FAgHq ukvJxZEtyOrgK4k4hPxstOL9Ls7lcQctC4BoLO2iCNWBHK+BCBEe5HbJCKC2Ow== From: Maxime Chevallier To: davem@davemloft.net, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , Heiner Kallweit Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Christophe Leroy , Herve Codina , Florian Fainelli , Vladimir Oltean , =?UTF-8?q?K=C3=B6ry=20Maincent?= , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Oleksij Rempel , =?UTF-8?q?Nicol=C3=B2=20Veronese?= , Simon Horman , mwojtas@chromium.org, Romain Gantois , Daniel Golle , Dimitri Fedrau Subject: [PATCH net-next v5 02/13] net: phy: phy_port: Cleanup the of-parsing logic for phy_port Date: Thu, 5 Feb 2026 10:23:05 +0100 Message-ID: <20260205092317.755906-3-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260205092317.755906-1-maxime.chevallier@bootlin.com> References: <20260205092317.755906-1-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" We don't need to maintain a mediums bitfield, let's drop it and drop a bogus check for empty mediums, as we already check it above. Signed-off-by: Maxime Chevallier --- drivers/net/phy/phy_port.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/phy_port.c b/drivers/net/phy/phy_port.c index ec93c8ca051e..a269e9ea12c4 100644 --- a/drivers/net/phy/phy_port.c +++ b/drivers/net/phy/phy_port.c @@ -53,7 +53,7 @@ struct phy_port *phy_of_parse_port(struct device_node *dn) enum ethtool_link_medium medium; struct phy_port *port; const char *med_str; - u32 pairs =3D 0, mediums =3D 0; + u32 pairs =3D 0; int ret; =20 ret =3D fwnode_property_read_string(fwnode, "media", &med_str); @@ -85,17 +85,12 @@ struct phy_port *phy_of_parse_port(struct device_node *= dn) return ERR_PTR(-EINVAL); } =20 - mediums |=3D BIT(medium); - - if (!mediums) - return ERR_PTR(-EINVAL); - port =3D phy_port_alloc(); if (!port) return ERR_PTR(-ENOMEM); =20 port->pairs =3D pairs; - port->mediums =3D mediums; + port->mediums =3D BIT(medium); =20 return port; } --=20 2.49.0