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) ...@@ -89,11 +89,6 @@ int usb_device_probe(struct device *dev)
if (!driver->probe) if (!driver->probe)
return error; 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); id = usb_match_id (intf, driver->id_table);
if (id) { if (id) {
dev_dbg (dev, "%s - got id\n", __FUNCTION__); dev_dbg (dev, "%s - got id\n", __FUNCTION__);
...@@ -104,8 +99,6 @@ int usb_device_probe(struct device *dev) ...@@ -104,8 +99,6 @@ int usb_device_probe(struct device *dev)
if (!error) if (!error)
intf->driver = driver; intf->driver = driver;
module_put(driver->owner);
return error; return error;
} }
...@@ -123,16 +116,6 @@ int usb_device_remove(struct device *dev) ...@@ -123,16 +116,6 @@ int usb_device_remove(struct device *dev)
return -ENODEV; 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); down(&driver->serialize);
if (intf->driver && intf->driver->disconnect) if (intf->driver && intf->driver->disconnect)
...@@ -143,7 +126,6 @@ int usb_device_remove(struct device *dev) ...@@ -143,7 +126,6 @@ int usb_device_remove(struct device *dev)
usb_driver_release_interface(driver, intf); usb_driver_release_interface(driver, intf);
up(&driver->serialize); up(&driver->serialize);
module_put(driver->owner);
return 0; 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