Lines Matching +full:device +full:- +full:id

6  *  Loosely based on drivers/pci/pci-driver.c
21 * zorro_match_device - Tell if a Zorro device structure has a matching
22 * Zorro device id structure
23 * @ids: array of Zorro device id structures to search in
24 * @dev: the Zorro device structure to match against
26 * Used by a driver to check whether a Zorro device present in the
35 while (ids->id) { in zorro_match_device()
36 if (ids->id == ZORRO_WILDCARD || ids->id == z->id) in zorro_match_device()
44 static int zorro_device_probe(struct device *dev) in zorro_device_probe()
47 struct zorro_driver *drv = to_zorro_driver(dev->driver); in zorro_device_probe()
50 if (drv->probe) { in zorro_device_probe()
51 const struct zorro_device_id *id; in zorro_device_probe() local
53 id = zorro_match_device(drv->id_table, z); in zorro_device_probe()
54 if (id) in zorro_device_probe()
55 error = drv->probe(z, id); in zorro_device_probe()
63 static void zorro_device_remove(struct device *dev) in zorro_device_remove()
66 struct zorro_driver *drv = to_zorro_driver(dev->driver); in zorro_device_remove()
68 if (drv->remove) in zorro_device_remove()
69 drv->remove(z); in zorro_device_remove()
74 * zorro_register_driver - register a new Zorro driver
84 drv->driver.name = drv->name; in zorro_register_driver()
85 drv->driver.bus = &zorro_bus_type; in zorro_register_driver()
88 return driver_register(&drv->driver); in zorro_register_driver()
94 * zorro_unregister_driver - unregister a zorro driver
99 * each device it was responsible for, and marks those devices as
105 driver_unregister(&drv->driver); in zorro_unregister_driver()
111 * zorro_bus_match - Tell if a Zorro device structure has a matching Zorro
112 * device id structure
113 * @ids: array of Zorro device id structures to search in
114 * @dev: the Zorro device structure to match against
116 * Used by the driver core to check whether a Zorro device present in the
121 static int zorro_bus_match(struct device *dev, struct device_driver *drv) in zorro_bus_match()
125 const struct zorro_device_id *ids = zorro_drv->id_table; in zorro_bus_match()
133 static int zorro_uevent(struct device *dev, struct kobj_uevent_env *env) in zorro_uevent()
138 return -ENODEV; in zorro_uevent()
142 return -ENODEV; in zorro_uevent()
144 if (add_uevent_var(env, "ZORRO_ID=%08X", z->id) || in zorro_uevent()
146 add_uevent_var(env, "ZORRO_SLOT_ADDR=%04X", z->slotaddr) || in zorro_uevent()
147 add_uevent_var(env, "MODALIAS=" ZORRO_DEVICE_MODALIAS_FMT, z->id)) in zorro_uevent()
148 return -ENOMEM; in zorro_uevent()