Re: [net-next v5 3/3] net: dsa: yt921x: Add support for Motorcomm YT921x

From: Russell King (Oracle)
Date: Thu Aug 21 2025 - 04:41:13 EST


On Wed, Aug 20, 2025 at 03:54:16PM +0800, David Yang wrote:
> +static int
> +yt921x_port_config(struct yt921x_priv *priv, int port, unsigned int mode,
> + const struct phylink_link_state *state)
> +{
> + const struct yt921x_info *info = priv->info;
> + struct device *dev = to_device(priv);
> + enum yt921x_fixed fixed;
> + bool duplex_full;
> + u32 mask;
> + u32 ctrl;
> + int res;
> +
> + if (state->interface != PHY_INTERFACE_MODE_INTERNAL &&
> + !yt921x_info_port_is_external(info, port)) {
> + dev_err(dev, "Wrong mode %d on port %d\n",
> + state->interface, port);
> + return -EINVAL;
> + }
> +
> + fixed = YT921X_FIXED_NOTFIXED;
> + ctrl = YT921X_PORT_LINK;
> + if (mode == MLO_AN_FIXED)
> + switch (state->speed) {

Someone clearly doesn't believe in reading the documentation before
writing code. This also hasn't been tested in any way. Sorry, but
I'm going to put as much effort into this review as you have into
understanding the phylink API, and thus my review ends here.

NAK.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!