Lines Matching refs:drv

97 static int bus_match(struct device_s * dev, struct device_driver * drv)  in bus_match()  argument
102 if (dev->bus->match(dev,drv)) { in bus_match()
103 dev->driver = drv; in bus_match()
105 if (drv->probe) { in bus_match()
106 if ((error = drv->probe(dev))) { in bus_match()
123 struct device_driver * drv; in device_attach() local
134 drv = (struct device_driver *)((char *)_mtr - (char *)offsetof(struct device_driver, bus_list) ); in device_attach()
135 if (!bus_match(dev,drv)) in device_attach()
145 void driver_attach(struct device_driver * drv) in driver_attach() argument
147 struct bus_type * bus = drv->bus; in driver_attach()
159 bus_match(dev,drv); in driver_attach()
168 struct device_driver * drv = dev->driver; in device_release_driver() local
170 if (drv) { in device_release_driver()
172 if (drv->remove) in device_release_driver()
173 drv->remove(dev); in device_release_driver()
180 static void driver_detach(struct device_driver * drv) in driver_detach() argument
186 list_for_each_safe(entry,next,&drv->devices) { in driver_detach()
219 int bus_add_driver(struct device_driver * drv) in bus_add_driver() argument
221 struct bus_type * bus = drv->bus; in bus_add_driver()
225 pr_debug("bus %s: add driver %s\n",bus->name,drv->name); in bus_add_driver()
228 list_add_tail(&drv->bus_list,&bus->drivers_list); in bus_add_driver()
229 driver_attach(drv); in bus_add_driver()
235 void bus_remove_driver(struct device_driver * drv) in bus_remove_driver() argument
237 if (drv->bus) { in bus_remove_driver()
238 pr_debug("bus %s: remove driver %s\n",drv->bus->name,drv->name); in bus_remove_driver()
239 driver_detach(drv); in bus_remove_driver()
240 list_del_init(&drv->bus_list); in bus_remove_driver()