Lines Matching refs:bus
45 * @bus: Pointer to MII bus structure.
54 static int arc_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
56 struct arc_emac_priv *priv = bus->priv;
77 * @bus: Pointer to MII bus structure.
86 static int arc_mdio_write(struct mii_bus *bus, int phy_addr,
89 struct arc_emac_priv *priv = bus->priv;
106 * (to allocate memory for MII bus structure) fails.
112 struct mii_bus *bus;
115 bus = mdiobus_alloc();
116 if (!bus)
119 priv->bus = bus;
120 bus->priv = priv;
121 bus->parent = priv->dev;
122 bus->name = "Synopsys MII Bus",
123 bus->read = &arc_mdio_read;
124 bus->write = &arc_mdio_write;
126 snprintf(bus->id, MII_BUS_ID_SIZE, "%s", bus->name);
128 error = of_mdiobus_register(bus, priv->dev->of_node);
130 dev_err(priv->dev, "cannot register MDIO bus %s\n", bus->name);
131 mdiobus_free(bus);
142 * Unregisters the MDIO and frees any associate memory for MII bus.
146 mdiobus_unregister(priv->bus);
147 mdiobus_free(priv->bus);
148 priv->bus = NULL;