Re: [PATCH net-next v7 1/2] net: mdio: Add RTL9300 MDIO driver

From: Maxime Chevallier
Date: Wed Feb 26 2025 - 02:45:29 EST


Hi Chris,

On Wed, 26 Feb 2025 13:07:47 +1300
Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx> wrote:

> Add a driver for the MDIO controller on the RTL9300 family of Ethernet
> switches with integrated SoC. There are 4 physical SMI interfaces on the
> RTL9300 however access is done using the switch ports. The driver takes
> the MDIO bus hierarchy from the DTS and uses this to configure the
> switch ports so they are associated with the correct PHY. This mapping
> is also used when dealing with software requests from phylib.
>
> Signed-off-by: Chris Packham <chris.packham@xxxxxxxxxxxxxxxxxxx>

It all mostly looks good to me, there's one typo though and as it may
be user visible, I think it's worth fixing...

[...]

> +static int rtl9300_mdiobus_probe_one(struct device *dev, struct rtl9300_mdio_priv *priv,
> + struct fwnode_handle *node)
> +{
> + struct rtl9300_mdio_chan *chan;
> + struct fwnode_handle *child;
> + struct mii_bus *bus;
> + u32 mdio_bus;
> + int err;
> +
> + err = fwnode_property_read_u32(node, "reg", &mdio_bus);
> + if (err)
> + return err;
> +
> + fwnode_for_each_child_node(node, child)
> + if (fwnode_device_is_compatible(child, "ethernet-phy-ieee802.3-c45"))
> + priv->smi_bus_is_c45[mdio_bus] = true;
> +
> + bus = devm_mdiobus_alloc_size(dev, sizeof(*chan));
> + if (!bus)
> + return -ENOMEM;
> +
> + bus->name = "Reaktek Switch MDIO Bus";

You probably mean Realtek ? :)

Thanks,

Maxime