arm: mvebu: a38x: Switch back to mdio_alloc()
Use mdio_alloc() again to allocate MDIO bus. This is possible because all the miiphybb parameters and ops passing is handled in at bb_miiphy_read()/bb_miiphy_write() level. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
This commit is contained in:
@@ -244,14 +244,9 @@ static int mii_bb_miiphy_write(struct mii_dev *miidev, int addr,
|
|||||||
|
|
||||||
int register_miiphy_bus(uint k, struct mii_dev **bus)
|
int register_miiphy_bus(uint k, struct mii_dev **bus)
|
||||||
{
|
{
|
||||||
struct bb_miiphy_bus *bb_miiphy = bb_miiphy_alloc();
|
struct mii_dev *mdiodev = mdio_alloc();
|
||||||
struct mii_dev *mdiodev;
|
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (!bb_miiphy)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
mdiodev = &bb_miiphy->mii;
|
|
||||||
snprintf(mdiodev->name, MDIO_NAME_LEN, "ihs%d", k);
|
snprintf(mdiodev->name, MDIO_NAME_LEN, "ihs%d", k);
|
||||||
mdiodev->read = mii_bb_miiphy_read;
|
mdiodev->read = mii_bb_miiphy_read;
|
||||||
mdiodev->write = mii_bb_miiphy_write;
|
mdiodev->write = mii_bb_miiphy_write;
|
||||||
@@ -260,7 +255,7 @@ int register_miiphy_bus(uint k, struct mii_dev **bus)
|
|||||||
retval = mdio_register(mdiodev);
|
retval = mdio_register(mdiodev);
|
||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
return retval;
|
return retval;
|
||||||
*bus = &bb_miiphy->mii;
|
*bus = mdiodev;
|
||||||
|
|
||||||
return mii_mdio_init(k);
|
return mii_mdio_init(k);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user