Lines Matching refs:dev

18 						struct mcb_device *dev)  in mcb_match_id()  argument
22 if (ids->device == dev->id) in mcb_match_id()
31 static int mcb_match(struct device *dev, struct device_driver *drv) in mcb_match() argument
34 struct mcb_device *mdev = to_mcb_device(dev); in mcb_match()
44 static int mcb_uevent(const struct device *dev, struct kobj_uevent_env *env) in mcb_uevent() argument
46 const struct mcb_device *mdev = to_mcb_device(dev); in mcb_uevent()
56 static int mcb_probe(struct device *dev) in mcb_probe() argument
58 struct mcb_driver *mdrv = to_mcb_driver(dev->driver); in mcb_probe()
59 struct mcb_device *mdev = to_mcb_device(dev); in mcb_probe()
68 carrier_mod = mdev->dev.parent->driver->owner; in mcb_probe()
72 get_device(dev); in mcb_probe()
76 put_device(dev); in mcb_probe()
82 static void mcb_remove(struct device *dev) in mcb_remove() argument
84 struct mcb_driver *mdrv = to_mcb_driver(dev->driver); in mcb_remove()
85 struct mcb_device *mdev = to_mcb_device(dev); in mcb_remove()
90 carrier_mod = mdev->dev.parent->driver->owner; in mcb_remove()
93 put_device(&mdev->dev); in mcb_remove()
96 static void mcb_shutdown(struct device *dev) in mcb_shutdown() argument
98 struct mcb_driver *mdrv = to_mcb_driver(dev->driver); in mcb_shutdown()
99 struct mcb_device *mdev = to_mcb_device(dev); in mcb_shutdown()
105 static ssize_t revision_show(struct device *dev, struct device_attribute *attr, in revision_show() argument
108 struct mcb_bus *bus = to_mcb_bus(dev); in revision_show()
114 static ssize_t model_show(struct device *dev, struct device_attribute *attr, in model_show() argument
117 struct mcb_bus *bus = to_mcb_bus(dev); in model_show()
123 static ssize_t minor_show(struct device *dev, struct device_attribute *attr, in minor_show() argument
126 struct mcb_bus *bus = to_mcb_bus(dev); in minor_show()
132 static ssize_t name_show(struct device *dev, struct device_attribute *attr, in name_show() argument
135 struct mcb_bus *bus = to_mcb_bus(dev); in name_show()
208 static void mcb_release_dev(struct device *dev) in mcb_release_dev() argument
210 struct mcb_device *mdev = to_mcb_device(dev); in mcb_release_dev()
223 int mcb_device_register(struct mcb_bus *bus, struct mcb_device *dev) in mcb_device_register() argument
228 device_initialize(&dev->dev); in mcb_device_register()
230 dev->dev.bus = &mcb_bus_type; in mcb_device_register()
231 dev->dev.parent = bus->dev.parent; in mcb_device_register()
232 dev->dev.release = mcb_release_dev; in mcb_device_register()
233 dev->dma_dev = bus->carrier; in mcb_device_register()
235 device_id = dev->id; in mcb_device_register()
236 dev_set_name(&dev->dev, "mcb%d-16z%03d-%d:%d:%d", in mcb_device_register()
237 bus->bus_nr, device_id, dev->inst, dev->group, dev->var); in mcb_device_register()
239 ret = device_add(&dev->dev); in mcb_device_register()
249 put_device(&dev->dev); in mcb_device_register()
255 static void mcb_free_bus(struct device *dev) in mcb_free_bus() argument
257 struct mcb_bus *bus = to_mcb_bus(dev); in mcb_free_bus()
288 device_initialize(&bus->dev); in mcb_alloc_bus()
289 bus->dev.parent = carrier; in mcb_alloc_bus()
290 bus->dev.bus = &mcb_bus_type; in mcb_alloc_bus()
291 bus->dev.type = &mcb_carrier_device_type; in mcb_alloc_bus()
292 bus->dev.release = &mcb_free_bus; in mcb_alloc_bus()
294 dev_set_name(&bus->dev, "mcb:%d", bus_nr); in mcb_alloc_bus()
295 rc = device_add(&bus->dev); in mcb_alloc_bus()
302 put_device(&bus->dev); in mcb_alloc_bus()
307 static int __mcb_devices_unregister(struct device *dev, void *data) in __mcb_devices_unregister() argument
309 device_unregister(dev); in __mcb_devices_unregister()
338 get_device(&bus->dev); in mcb_bus_get()
353 put_device(&bus->dev); in mcb_bus_put()
365 struct mcb_device *dev; in mcb_alloc_dev() local
367 dev = kzalloc(sizeof(struct mcb_device), GFP_KERNEL); in mcb_alloc_dev()
368 if (!dev) in mcb_alloc_dev()
371 dev->bus = bus; in mcb_alloc_dev()
373 return dev; in mcb_alloc_dev()
383 void mcb_free_dev(struct mcb_device *dev) in mcb_free_dev() argument
385 kfree(dev); in mcb_free_dev()
389 static int __mcb_bus_add_devices(struct device *dev, void *data) in __mcb_bus_add_devices() argument
393 retval = device_attach(dev); in __mcb_bus_add_devices()
395 dev_err(dev, "Error adding device (%d)\n", retval); in __mcb_bus_add_devices()
419 struct resource *mcb_get_resource(struct mcb_device *dev, unsigned int type) in mcb_get_resource() argument
422 return &dev->mem; in mcb_get_resource()
424 return &dev->irq; in mcb_get_resource()
438 struct resource *mcb_request_mem(struct mcb_device *dev, const char *name) in mcb_request_mem() argument
444 name = dev->dev.driver->name; in mcb_request_mem()
446 size = resource_size(&dev->mem); in mcb_request_mem()
448 mem = request_mem_region(dev->mem.start, size, name); in mcb_request_mem()
471 static int __mcb_get_irq(struct mcb_device *dev) in __mcb_get_irq() argument
475 irq = mcb_get_resource(dev, IORESOURCE_IRQ); in __mcb_get_irq()
486 int mcb_get_irq(struct mcb_device *dev) in mcb_get_irq() argument
488 struct mcb_bus *bus = dev->bus; in mcb_get_irq()
491 return bus->get_irq(dev); in mcb_get_irq()
493 return __mcb_get_irq(dev); in mcb_get_irq()