Commit f44a0a63 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

[PATCH] USB: leave usage counts during probe/remove to driver core

driver core protects us with semaphores during probe/disconnect. We can
stop messing with the module usage counts.
parent 261d8da7
......@@ -89,11 +89,6 @@ int usb_device_probe(struct device *dev)
if (!driver->probe)
return error;
if (!try_module_get(driver->owner)) {
dev_err (dev, "Can't get a module reference for %s\n", driver->name);
return error;
}
id = usb_match_id (intf, driver->id_table);
if (id) {
dev_dbg (dev, "%s - got id\n", __FUNCTION__);
......@@ -104,8 +99,6 @@ int usb_device_probe(struct device *dev)
if (!error)
intf->driver = driver;
module_put(driver->owner);
return error;
}
......@@ -123,16 +116,6 @@ int usb_device_remove(struct device *dev)
return -ENODEV;
}
if (!try_module_get(driver->owner)) {
// FIXME this happens even when we just rmmod
// drivers that aren't in active use...
dev_err(dev, "Dieing driver still bound to device.\n");
return -EIO;
}
/* if we sleep here on an umanaged driver
* the holder of the lock guards against
* module unload */
down(&driver->serialize);
if (intf->driver && intf->driver->disconnect)
......@@ -143,7 +126,6 @@ int usb_device_remove(struct device *dev)
usb_driver_release_interface(driver, intf);
up(&driver->serialize);
module_put(driver->owner);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment