Lines Matching full:pb

41 	struct mdio_mux_parent_bus *pb = cb->parent;  in mdio_mux_read()  local
44 mutex_lock_nested(&pb->mii_bus->mdio_lock, MDIO_MUTEX_MUX); 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()
51 r = pb->mii_bus->read(pb->mii_bus, phy_id, regnum); in mdio_mux_read()
53 mutex_unlock(&pb->mii_bus->mdio_lock); in mdio_mux_read()
65 struct mdio_mux_parent_bus *pb = cb->parent; in mdio_mux_write() local
69 mutex_lock_nested(&pb->mii_bus->mdio_lock, MDIO_MUTEX_MUX); 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()
76 r = pb->mii_bus->write(pb->mii_bus, phy_id, regnum, val); in mdio_mux_write()
78 mutex_unlock(&pb->mii_bus->mdio_lock); in mdio_mux_write()
85 static void mdio_mux_uninit_children(struct mdio_mux_parent_bus *pb) in mdio_mux_uninit_children() argument
87 struct mdio_mux_child_bus *cb = pb->children; in mdio_mux_uninit_children()
107 struct mdio_mux_parent_bus *pb; in mdio_mux_init() local
131 pb = devm_kzalloc(dev, sizeof(*pb), GFP_KERNEL); in mdio_mux_init()
132 if (!pb) { in mdio_mux_init()
137 pb->switch_data = data; in mdio_mux_init()
138 pb->switch_fn = switch_fn; in mdio_mux_init()
139 pb->current_child = -1; in mdio_mux_init()
140 pb->parent_id = parent_count++; in mdio_mux_init()
141 pb->mii_bus = parent_bus; in mdio_mux_init()
161 cb->parent = pb; in mdio_mux_init()
172 cb->mii_bus->name, pb->parent_id, v); in mdio_mux_init()
188 cb->next = pb->children; in mdio_mux_init()
189 pb->children = cb; in mdio_mux_init()
192 if (pb->children) { in mdio_mux_init()
193 *mux_handle = pb; in mdio_mux_init()
200 mdio_mux_uninit_children(pb); in mdio_mux_init()
212 struct mdio_mux_parent_bus *pb = mux_handle; in mdio_mux_uninit() local
214 mdio_mux_uninit_children(pb); in mdio_mux_uninit()
215 put_device(&pb->mii_bus->dev); in mdio_mux_uninit()