Lines Matching full:bus

3  * MEN Chameleon Bus.
109 struct mcb_bus *bus = to_mcb_bus(dev); in revision_show() local
111 return sysfs_emit(buf, "%d\n", bus->revision); in revision_show()
118 struct mcb_bus *bus = to_mcb_bus(dev); in model_show() local
120 return sysfs_emit(buf, "%c\n", bus->model); in model_show()
127 struct mcb_bus *bus = to_mcb_bus(dev); in minor_show() local
129 return sysfs_emit(buf, "%d\n", bus->minor); in minor_show()
136 struct mcb_bus *bus = to_mcb_bus(dev); in name_show() local
138 return sysfs_emit(buf, "%s\n", bus->name); in name_show()
190 drv->driver.bus = &mcb_bus_type; in __mcb_register_driver()
213 mcb_bus_put(mdev->bus); in mcb_release_dev()
219 * @bus: The @mcb_bus of the device
224 int mcb_device_register(struct mcb_bus *bus, struct mcb_device *dev) in mcb_device_register() argument
230 mcb_bus_get(bus); in mcb_device_register()
231 dev->dev.bus = &mcb_bus_type; in mcb_device_register()
232 dev->dev.parent = bus->dev.parent; in mcb_device_register()
234 dev->dma_dev = bus->carrier; in mcb_device_register()
238 bus->bus_nr, device_id, dev->inst, dev->group, dev->var); in mcb_device_register()
242 pr_err("Failed registering device 16z%03d on bus mcb%d (%d)\n", in mcb_device_register()
243 device_id, bus->bus_nr, ret); in mcb_device_register()
258 struct mcb_bus *bus = to_mcb_bus(dev); in mcb_free_bus() local
260 put_device(bus->carrier); in mcb_free_bus()
261 ida_free(&mcb_ida, bus->bus_nr); in mcb_free_bus()
262 kfree(bus); in mcb_free_bus()
273 struct mcb_bus *bus; in mcb_alloc_bus() local
277 bus = kzalloc_obj(struct mcb_bus); in mcb_alloc_bus()
278 if (!bus) in mcb_alloc_bus()
283 kfree(bus); in mcb_alloc_bus()
287 bus->bus_nr = bus_nr; in mcb_alloc_bus()
288 bus->carrier = get_device(carrier); in mcb_alloc_bus()
290 device_initialize(&bus->dev); in mcb_alloc_bus()
291 bus->dev.parent = carrier; in mcb_alloc_bus()
292 bus->dev.bus = &mcb_bus_type; in mcb_alloc_bus()
293 bus->dev.type = &mcb_carrier_device_type; in mcb_alloc_bus()
294 bus->dev.release = mcb_free_bus; in mcb_alloc_bus()
296 dev_set_name(&bus->dev, "mcb:%d", bus_nr); in mcb_alloc_bus()
297 rc = device_add(&bus->dev); in mcb_alloc_bus()
301 return bus; in mcb_alloc_bus()
304 put_device(&bus->dev); in mcb_alloc_bus()
315 static void mcb_devices_unregister(struct mcb_bus *bus) in mcb_devices_unregister() argument
317 bus_for_each_dev(bus->dev.bus, NULL, NULL, __mcb_devices_unregister); in mcb_devices_unregister()
321 * @bus: The @mcb_bus to release
325 void mcb_release_bus(struct mcb_bus *bus) in mcb_release_bus() argument
327 mcb_devices_unregister(bus); in mcb_release_bus()
333 * @bus: The @mcb_bus
337 struct mcb_bus *mcb_bus_get(struct mcb_bus *bus) in mcb_bus_get() argument
339 if (bus) in mcb_bus_get()
340 get_device(&bus->dev); in mcb_bus_get()
342 return bus; in mcb_bus_get()
348 * @bus: The @mcb_bus
352 void mcb_bus_put(struct mcb_bus *bus) in mcb_bus_put() argument
354 if (bus) in mcb_bus_put()
355 put_device(&bus->dev); in mcb_bus_put()
361 * @bus: The @mcb_bus the device is part of
363 * Allocate a @mcb_device and add bus.
365 struct mcb_device *mcb_alloc_dev(struct mcb_bus *bus) in mcb_alloc_dev() argument
373 dev->bus = bus; in mcb_alloc_dev()
405 * mcb_bus_add_devices() - Add devices in the bus' internal device list
406 * @bus: The @mcb_bus we add the devices
408 * Add devices in the bus' internal device list to the system.
410 void mcb_bus_add_devices(const struct mcb_bus *bus) in mcb_bus_add_devices() argument
412 bus_for_each_dev(bus->dev.bus, NULL, NULL, __mcb_bus_add_devices); in mcb_bus_add_devices()
490 struct mcb_bus *bus = dev->bus; in mcb_get_irq() local
492 if (bus->get_irq) in mcb_get_irq()
493 return bus->get_irq(dev); in mcb_get_irq()
517 MODULE_DESCRIPTION("MEN Chameleon Bus Driver");