Lines Matching full:cb
40 struct mdio_mux_child_bus *cb = bus->priv; in mdio_mux_read() local
41 struct mdio_mux_parent_bus *pb = cb->parent; in mdio_mux_read()
45 r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); in mdio_mux_read()
49 pb->current_child = cb->bus_number; in mdio_mux_read()
64 struct mdio_mux_child_bus *cb = bus->priv; in mdio_mux_write() local
65 struct mdio_mux_parent_bus *pb = cb->parent; in mdio_mux_write()
70 r = pb->switch_fn(pb->current_child, cb->bus_number, pb->switch_data); in mdio_mux_write()
74 pb->current_child = cb->bus_number; in mdio_mux_write()
87 struct mdio_mux_child_bus *cb = pb->children; in mdio_mux_uninit_children() local
89 while (cb) { in mdio_mux_uninit_children()
90 mdiobus_unregister(cb->mii_bus); in mdio_mux_uninit_children()
91 mdiobus_free(cb->mii_bus); in mdio_mux_uninit_children()
92 cb = cb->next; in mdio_mux_uninit_children()
108 struct mdio_mux_child_bus *cb; in mdio_mux_init() local
155 cb = devm_kzalloc(dev, sizeof(*cb), GFP_KERNEL); in mdio_mux_init()
156 if (!cb) { in mdio_mux_init()
160 cb->bus_number = v; in mdio_mux_init()
161 cb->parent = pb; in mdio_mux_init()
163 cb->mii_bus = mdiobus_alloc(); in mdio_mux_init()
164 if (!cb->mii_bus) { in mdio_mux_init()
168 cb->mii_bus->priv = cb; in mdio_mux_init()
170 cb->mii_bus->name = "mdio_mux"; in mdio_mux_init()
171 snprintf(cb->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x.%x", in mdio_mux_init()
172 cb->mii_bus->name, pb->parent_id, v); in mdio_mux_init()
173 cb->mii_bus->parent = dev; in mdio_mux_init()
174 cb->mii_bus->read = mdio_mux_read; in mdio_mux_init()
175 cb->mii_bus->write = mdio_mux_write; in mdio_mux_init()
176 r = of_mdiobus_register(cb->mii_bus, child_bus_node); in mdio_mux_init()
178 mdiobus_free(cb->mii_bus); in mdio_mux_init()
183 devm_kfree(dev, cb); in mdio_mux_init()
188 cb->next = pb->children; in mdio_mux_init()
189 pb->children = cb; in mdio_mux_init()