Re: [PATCH net-next v1 3/5] net: dsa: microchip: Refactor MDIO handling for side MDIO access

From: Andrew Lunn
Date: Mon Oct 28 2024 - 08:10:24 EST


> static int ksz_mdio_register(struct ksz_device *dev)
> {
> + struct device_node *parent_bus_node;
> + struct mii_bus *parent_bus = NULL;
> struct dsa_switch *ds = dev->ds;
> struct device_node *mdio_np;
> struct mii_bus *bus;
> - int ret;
> + struct dsa_port *dp;
> + int ret, i;
>
> mdio_np = of_get_child_by_name(dev->dev->of_node, "mdio");
> if (!mdio_np)
> return 0;
>
> + parent_bus_node = of_parse_phandle(mdio_np, "mdio-parent-bus", 0);
> + if (parent_bus_node && !dev->info->phy_side_mdio_supported) {
> + dev_warn(dev->dev, "Side MDIO bus is not supported for this HW, ignoring 'mdio-parent-bus' property.\n");

I think dev_err() and return -EINVAL. It is an error in the DT.


Andrew

---
pw-bot: cr