net: designware: Extract bbmiiphy initialization into dedicated function
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Sat, 22 Feb 2025 20:33:21 +0000 (21:33 +0100)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Wed, 26 Feb 2025 17:26:57 +0000 (18:26 +0100)
commita6a38bba5d14d68d2d86e137b7408393f29c5b7a
tree9753c8cb9f0444d8ab25ab48a7a0c14d8dc6e5bd
parentce6431141a4ad220935bbe27dd12ab569f38e263
net: designware: Extract bbmiiphy initialization into dedicated function

Pull the bbmiiphy initialization code from designware_eth_probe() into
dedicated function, dw_bb_mdio_init(), just like all the other MDIO
initialization functions.

Keep check for "snps,bitbang-mii" in the designware_eth_probe(), so the
driver can initialize this MDIO only in case the property is present,
and initialize regular DW MDIO in case it is not present.

The dw_bb_mdio_init() allocates its own MDIO instance, because thus far
code gated behind "snps,bitbang-mii" did depend on allocation of MDIO bus
by the other two MDIO bus options and then rewrote the newly allocated
MDIO bus callbacks, which is wrong, instead allocate proper MDIO bus with
the correct callbacks outright.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
drivers/net/designware.c