Lines Matching refs:bus
39 static int sun4i_mdio_read(struct mii_bus *bus, int mii_id, int regnum) in sun4i_mdio_read() argument
41 struct sun4i_mdio_data *data = bus->priv; in sun4i_mdio_read()
66 static int sun4i_mdio_write(struct mii_bus *bus, int mii_id, int regnum, in sun4i_mdio_write() argument
69 struct sun4i_mdio_data *data = bus->priv; in sun4i_mdio_write()
96 struct mii_bus *bus; in sun4i_mdio_probe() local
101 bus = mdiobus_alloc_size(sizeof(*data)); in sun4i_mdio_probe()
102 if (!bus) in sun4i_mdio_probe()
105 bus->name = "sun4i_mii_bus"; in sun4i_mdio_probe()
106 bus->read = &sun4i_mdio_read; in sun4i_mdio_probe()
107 bus->write = &sun4i_mdio_write; in sun4i_mdio_probe()
108 snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(&pdev->dev)); in sun4i_mdio_probe()
109 bus->parent = &pdev->dev; in sun4i_mdio_probe()
111 bus->irq = devm_kzalloc(&pdev->dev, sizeof(int) * PHY_MAX_ADDR, in sun4i_mdio_probe()
113 if (!bus->irq) { in sun4i_mdio_probe()
119 bus->irq[i] = PHY_POLL; in sun4i_mdio_probe()
121 data = bus->priv; in sun4i_mdio_probe()
141 ret = of_mdiobus_register(bus, np); in sun4i_mdio_probe()
145 platform_set_drvdata(pdev, bus); in sun4i_mdio_probe()
152 mdiobus_free(bus); in sun4i_mdio_probe()
158 struct mii_bus *bus = platform_get_drvdata(pdev); in sun4i_mdio_remove() local
160 mdiobus_unregister(bus); in sun4i_mdio_remove()
161 mdiobus_free(bus); in sun4i_mdio_remove()