[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <daa8c723-1800-4c79-8fa1-b7d47f80c4d4@kernel.org>
Date: Wed, 11 Feb 2026 10:38:40 +0100
From: "Christophe Leroy (CS GROUP)" <chleroy@...nel.org>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>, davem@...emloft.net,
Andrew Lunn <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Russell King <linux@...linux.org.uk>, Heiner Kallweit <hkallweit1@...il.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
thomas.petazzoni@...tlin.com, Herve Codina <herve.codina@...tlin.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Köry Maincent <kory.maincent@...tlin.com>,
Marek Behún <kabel@...nel.org>,
Oleksij Rempel <o.rempel@...gutronix.de>,
Nicolò Veronese <nicveronese@...il.com>,
Simon Horman <horms@...nel.org>, mwojtas@...omium.org,
Romain Gantois <romain.gantois@...tlin.com>,
Daniel Golle <daniel@...rotopia.org>,
Dimitri Fedrau <dimitri.fedrau@...bherr.com>
Subject: Re: [PATCH net-next v5 02/13] net: phy: phy_port: Cleanup the
of-parsing logic for phy_port
Le 05/02/2026 à 10:23, Maxime Chevallier a écrit :
> 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 <maxime.chevallier@...tlin.com>
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@...nel.org>
> ---
> 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 = 0, mediums = 0;
> + u32 pairs = 0;
> int ret;
>
> ret = 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);
> }
>
> - mediums |= BIT(medium);
> -
> - if (!mediums)
> - return ERR_PTR(-EINVAL);
> -
> port = phy_port_alloc();
> if (!port)
> return ERR_PTR(-ENOMEM);
>
> port->pairs = pairs;
> - port->mediums = mediums;
> + port->mediums = BIT(medium);
>
> return port;
> }
Powered by blists - more mailing lists