Lines Matching +full:device +full:- +full:id
6 * Loosely based on drivers/pci/pci-driver.c and drivers/zorro/zorro-driver.c
19 * dio_match_device - Tell if a DIO device structure has a matching DIO device id structure
20 * @ids: array of DIO device id structures to search in
21 * @d: the DIO device structure to match against
23 * Used by a driver to check whether a DIO device present in the
32 while (ids->id) { in dio_match_device()
33 if (ids->id == DIO_WILDCARD) in dio_match_device()
35 if (DIO_NEEDSSECID(ids->id & 0xff)) { in dio_match_device()
36 if (ids->id == d->id) in dio_match_device()
39 if ((ids->id & 0xff) == (d->id & 0xff)) in dio_match_device()
47 static int dio_device_probe(struct device *dev) in dio_device_probe()
50 struct dio_driver *drv = to_dio_driver(dev->driver); in dio_device_probe()
53 if (!d->driver && drv->probe) { in dio_device_probe()
54 const struct dio_device_id *id; in dio_device_probe() local
56 id = dio_match_device(drv->id_table, d); in dio_device_probe()
57 if (id) in dio_device_probe()
58 error = drv->probe(d, id); in dio_device_probe()
60 d->driver = drv; in dio_device_probe()
69 * dio_register_driver - register a new DIO driver
79 drv->driver.name = drv->name; in dio_register_driver()
80 drv->driver.bus = &dio_bus_type; in dio_register_driver()
83 return driver_register(&drv->driver); in dio_register_driver()
88 * dio_unregister_driver - unregister a DIO driver
93 * each device it was responsible for, and marks those devices as
99 driver_unregister(&drv->driver); in dio_unregister_driver()
104 * dio_bus_match - Tell if a DIO device structure has a matching DIO device id structure
105 * @dev: the DIO device structure to match against
106 * @drv: the &device_driver that points to the array of DIO device id structures to search
108 * Used by the driver core to check whether a DIO device present in the
113 static int dio_bus_match(struct device *dev, struct device_driver *drv) in dio_bus_match()
117 const struct dio_device_id *ids = dio_drv->id_table; in dio_bus_match()