Lines Matching defs:drv
222 const char *drv = dev_driver_string(dev);
227 dev->p->deferred_probe_reason = kasprintf(GFP_KERNEL, "%s: %pV", drv, vaf);
435 struct device_driver *drv = dev->driver;
437 if (drv) {
438 if (drv->coredump)
440 sysfs_remove_link(&drv->p->kobj, kobject_name(&dev->kobj));
497 static int really_probe(struct device *dev, struct device_driver *drv)
502 !drv->suppress_bind_attrs;
510 dev_dbg(dev, "Driver %s force probe deferral\n", drv->name);
523 drv->bus->name, __func__, drv->name, dev_name(dev));
531 dev->driver = drv;
561 } else if (drv->probe) {
562 ret = drv->probe(dev);
567 ret = device_add_groups(dev, drv->dev_groups);
585 device_remove_groups(dev, drv->dev_groups);
589 else if (drv->remove)
590 drv->remove(dev);
614 drv->bus->name, __func__, dev_name(dev), drv->name);
618 device_remove_groups(dev, drv->dev_groups);
622 else if (drv->remove)
623 drv->remove(dev);
645 dev_dbg(dev, "Driver %s requests probe deferral\n", drv->name);
651 drv->name, dev_name(dev), ret);
656 drv->name, dev_name(dev), ret);
672 static int really_probe_debug(struct device *dev, struct device_driver *drv)
678 ret = really_probe(dev, drv);
723 * @drv: driver to bind a device to
734 int driver_probe_device(struct device_driver *drv, struct device *dev)
742 drv->bus->name, __func__, dev_name(dev), drv->name);
750 ret = really_probe_debug(dev, drv);
752 ret = really_probe(dev, drv);
778 bool driver_allows_async_probing(struct device_driver *drv)
780 switch (drv->probe_type) {
788 if (cmdline_requested_async_probing(drv->name))
791 if (module_requested_async_probing(drv->owner))
831 static int __device_attach_driver(struct device_driver *drv, void *_data)
838 ret = driver_match_device(drv, dev);
855 async_allowed = driver_allows_async_probing(drv);
863 return driver_probe_device(drv, dev);
985 * __device_driver_lock - acquire locks needed to manipulate dev->drv
989 * This function will take the required locks for manipulating dev->drv.
1001 * __device_driver_unlock - release locks needed to manipulate dev->drv
1005 * This function will release the required locks for manipulating dev->drv.
1018 * @drv: Driver to attach
1024 int device_driver_attach(struct device_driver *drv, struct device *dev)
1035 ret = driver_probe_device(drv, dev);
1045 struct device_driver *drv;
1050 drv = dev->p->async_driver;
1057 ret = driver_probe_device(drv, dev);
1061 dev_dbg(dev, "driver %s async attach completed: %d\n", drv->name, ret);
1068 struct device_driver *drv = data;
1082 ret = driver_match_device(drv, dev);
1103 if (driver_allows_async_probing(drv)) {
1111 dev_dbg(dev, "probing driver %s asynchronously\n", drv->name);
1115 dev->p->async_driver = drv;
1124 device_driver_attach(drv, dev);
1131 * @drv: driver.
1138 int driver_attach(struct device_driver *drv)
1140 return bus_for_each_dev(drv->bus, NULL, drv, __driver_attach);
1150 struct device_driver *drv;
1152 drv = dev->driver;
1153 if (drv) {
1167 if (dev->driver != drv) {
1183 device_remove_groups(dev, drv->dev_groups);
1187 else if (drv->remove)
1188 drv->remove(dev);
1215 struct device_driver *drv,
1220 if (!drv || drv == dev->driver)
1262 * @drv: driver.
1264 void driver_detach(struct device_driver *drv)
1269 if (driver_allows_async_probing(drv))
1273 spin_lock(&drv->p->klist_devices.k_lock);
1274 if (list_empty(&drv->p->klist_devices.k_list)) {
1275 spin_unlock(&drv->p->klist_devices.k_lock);
1278 dev_prv = list_last_entry(&drv->p->klist_devices.k_list,
1283 spin_unlock(&drv->p->klist_devices.k_lock);
1284 device_release_driver_internal(dev, drv, dev->parent);