Commit 0d2f3b87 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'mdio-mux-cleanup'

Vladimir Oltean says:

====================
MDIO mux cleanup

This small patch set resolves some technical debt in the MDIO mux driver
which was discovered during the investigation for commit 1f9f2143
("net: mdio-mux: fix C45 access returning -EIO after API change").

The patches have been sitting for 2 months in the NXP SDK kernel and
haven't caused issues.
====================

Link: https://lore.kernel.org/r/20231213152712.320842-1-vladimir.oltean@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents b3cb7a83 10ad63da
......@@ -190,8 +190,8 @@ int mdio_mux_init(struct device *dev,
r = of_property_read_u32(child_bus_node, "reg", &v);
if (r) {
dev_err(dev,
"Error: Failed to find reg for child %pOF\n",
child_bus_node);
"Error: Failed to find reg for child %pOF: %pe\n",
child_bus_node, ERR_PTR(r));
continue;
}
......@@ -214,8 +214,10 @@ int mdio_mux_init(struct device *dev,
snprintf(cb->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x.%x",
cb->mii_bus->name, pb->parent_id, v);
cb->mii_bus->parent = dev;
cb->mii_bus->read = mdio_mux_read;
cb->mii_bus->write = mdio_mux_write;
if (parent_bus->read)
cb->mii_bus->read = mdio_mux_read;
if (parent_bus->write)
cb->mii_bus->write = mdio_mux_write;
if (parent_bus->read_c45)
cb->mii_bus->read_c45 = mdio_mux_read_c45;
if (parent_bus->write_c45)
......@@ -229,8 +231,8 @@ int mdio_mux_init(struct device *dev,
}
devm_kfree(dev, cb);
dev_err(dev,
"Error: Failed to register MDIO bus for child %pOF\n",
child_bus_node);
"Error: Failed to register MDIO bus for child %pOF: %pe\n",
child_bus_node, ERR_PTR(r));
} else {
cb->next = pb->children;
pb->children = cb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment