Lines Matching refs:drv
442 struct device_driver *drv = dev->driver; in driver_sysfs_remove() local
444 if (drv) { in driver_sysfs_remove()
445 if (drv->coredump) in driver_sysfs_remove()
447 sysfs_remove_link(&drv->p->kobj, kobject_name(&dev->kobj)); in driver_sysfs_remove()
492 static int really_probe(struct device *dev, struct device_driver *drv) in really_probe() argument
497 !drv->suppress_bind_attrs; in really_probe()
505 dev_dbg(dev, "Driver %s force probe deferral\n", drv->name); in really_probe()
518 drv->bus->name, __func__, drv->name, dev_name(dev)); in really_probe()
522 dev->driver = drv; in really_probe()
551 } else if (drv->probe) { in really_probe()
552 ret = drv->probe(dev); in really_probe()
557 if (device_add_groups(dev, drv->dev_groups)) { in really_probe()
565 device_remove_groups(dev, drv->dev_groups); in really_probe()
569 else if (drv->remove) in really_probe()
570 drv->remove(dev); in really_probe()
591 drv->bus->name, __func__, dev_name(dev), drv->name); in really_probe()
597 else if (drv->remove) in really_probe()
598 drv->remove(dev); in really_probe()
618 dev_dbg(dev, "Driver %s requests probe deferral\n", drv->name); in really_probe()
624 drv->name, dev_name(dev), ret); in really_probe()
630 drv->name, dev_name(dev), ret); in really_probe()
646 static int really_probe_debug(struct device *dev, struct device_driver *drv) in really_probe_debug() argument
652 ret = really_probe(dev, drv); in really_probe_debug()
703 int driver_probe_device(struct device_driver *drv, struct device *dev) in driver_probe_device() argument
711 drv->bus->name, __func__, dev_name(dev), drv->name); in driver_probe_device()
719 ret = really_probe_debug(dev, drv); in driver_probe_device()
721 ret = really_probe(dev, drv); in driver_probe_device()
748 bool driver_allows_async_probing(struct device_driver *drv) in driver_allows_async_probing() argument
750 switch (drv->probe_type) { in driver_allows_async_probing()
758 if (cmdline_requested_async_probing(drv->name)) in driver_allows_async_probing()
761 if (module_requested_async_probing(drv->owner)) in driver_allows_async_probing()
801 static int __device_attach_driver(struct device_driver *drv, void *_data) in __device_attach_driver() argument
808 ret = driver_match_device(drv, dev); in __device_attach_driver()
820 async_allowed = driver_allows_async_probing(drv); in __device_attach_driver()
828 return driver_probe_device(drv, dev); in __device_attach_driver()
984 int device_driver_attach(struct device_driver *drv, struct device *dev) in device_driver_attach() argument
995 ret = driver_probe_device(drv, dev); in device_driver_attach()
1005 struct device_driver *drv; in __driver_attach_async_helper() local
1010 drv = dev->p->async_driver; in __driver_attach_async_helper()
1017 ret = driver_probe_device(drv, dev); in __driver_attach_async_helper()
1021 dev_dbg(dev, "driver %s async attach completed: %d\n", drv->name, ret); in __driver_attach_async_helper()
1028 struct device_driver *drv = data; in __driver_attach() local
1041 ret = driver_match_device(drv, dev); in __driver_attach()
1053 if (driver_allows_async_probing(drv)) { in __driver_attach()
1061 dev_dbg(dev, "probing driver %s asynchronously\n", drv->name); in __driver_attach()
1065 dev->p->async_driver = drv; in __driver_attach()
1072 device_driver_attach(drv, dev); in __driver_attach()
1086 int driver_attach(struct device_driver *drv) in driver_attach() argument
1088 return bus_for_each_dev(drv->bus, NULL, drv, __driver_attach); in driver_attach()
1098 struct device_driver *drv; in __device_release_driver() local
1100 drv = dev->driver; in __device_release_driver()
1101 if (drv) { in __device_release_driver()
1113 if (dev->driver != drv) in __device_release_driver()
1129 device_remove_groups(dev, drv->dev_groups); in __device_release_driver()
1133 else if (drv->remove) in __device_release_driver()
1134 drv->remove(dev); in __device_release_driver()
1159 struct device_driver *drv, in device_release_driver_internal() argument
1164 if (!drv || drv == dev->driver) in device_release_driver_internal()
1208 void driver_detach(struct device_driver *drv) in driver_detach() argument
1213 if (driver_allows_async_probing(drv)) in driver_detach()
1217 spin_lock(&drv->p->klist_devices.k_lock); in driver_detach()
1218 if (list_empty(&drv->p->klist_devices.k_list)) { in driver_detach()
1219 spin_unlock(&drv->p->klist_devices.k_lock); in driver_detach()
1222 dev_prv = list_entry(drv->p->klist_devices.k_list.prev, in driver_detach()
1227 spin_unlock(&drv->p->klist_devices.k_lock); in driver_detach()
1228 device_release_driver_internal(dev, drv, dev->parent); in driver_detach()