summaryrefslogtreecommitdiff
path: root/drivers/net/ravb.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2025-03-02 02:24:42 +0100
committerMarek Vasut <marek.vasut+renesas@mailbox.org>2025-03-11 23:05:57 +0100
commitc9671c9036d465e0681d947b0b7a76019a096758 (patch)
tree799f879b5bd48687923b9087cedcca76a132feb9 /drivers/net/ravb.c
parent0e5f1b8f052bfc8f2a30ae4dd958371242b4b8dd (diff)
net: miiphybb: Split off struct bb_miiphy_bus_ops
Move miiphybb operations into separate struct bb_miiphy_bus_ops structure, add pointer to struct bb_miiphy_bus_ops into the base struct bb_miiphy_bus and access the ops through this pointer in miiphybb generic code. The variable reshuffling in miiphybb.c cannot be easily avoided. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Diffstat (limited to 'drivers/net/ravb.c')
-rw-r--r--drivers/net/ravb.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index cb727ae9bc1..bd4900270a2 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -549,6 +549,15 @@ static int ravb_bb_delay(struct bb_miiphy_bus *bus)
return 0;
}
+static const struct bb_miiphy_bus_ops ravb_bb_miiphy_bus_ops = {
+ .mdio_active = ravb_bb_mdio_active,
+ .mdio_tristate = ravb_bb_mdio_tristate,
+ .set_mdio = ravb_bb_set_mdio,
+ .get_mdio = ravb_bb_get_mdio,
+ .set_mdc = ravb_bb_set_mdc,
+ .delay = ravb_bb_delay,
+};
+
static int ravb_probe(struct udevice *dev)
{
struct eth_pdata *pdata = dev_get_plat(dev);
@@ -578,12 +587,7 @@ static int ravb_probe(struct udevice *dev)
snprintf(mdiodev->name, sizeof(mdiodev->name), dev->name);
/* Copy the bus accessors and private data */
- bb_miiphy->mdio_active = ravb_bb_mdio_active;
- bb_miiphy->mdio_tristate = ravb_bb_mdio_tristate;
- bb_miiphy->set_mdio = ravb_bb_set_mdio;
- bb_miiphy->get_mdio = ravb_bb_get_mdio;
- bb_miiphy->set_mdc = ravb_bb_set_mdc;
- bb_miiphy->delay = ravb_bb_delay;
+ bb_miiphy->ops = &ravb_bb_miiphy_bus_ops;
bb_miiphy->priv = eth;
ret = mdio_register(mdiodev);