Commit 439683c2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: get previous module patch to even build properly...

parent 60bd3b5e
...@@ -1129,7 +1129,7 @@ static int proc_ioctl (struct dev_state *ps, void *arg) ...@@ -1129,7 +1129,7 @@ static int proc_ioctl (struct dev_state *ps, void *arg)
} }
unlock_kernel (); unlock_kernel ();
retval = driver->ioctl (ifp, ctrl.ioctl_code, buf); retval = driver->ioctl (ifp, ctrl.ioctl_code, buf);
put_module (driver->owner); module_put (driver->owner);
} }
if (retval == -ENOIOCTLCMD) if (retval == -ENOIOCTLCMD)
......
...@@ -77,15 +77,16 @@ int usb_device_probe(struct device *dev) ...@@ -77,15 +77,16 @@ int usb_device_probe(struct device *dev)
struct usb_driver * driver = to_usb_driver(dev->driver); struct usb_driver * driver = to_usb_driver(dev->driver);
const struct usb_device_id *id; const struct usb_device_id *id;
int error = -ENODEV; int error = -ENODEV;
int m;
dbg("%s", __FUNCTION__); dbg("%s", __FUNCTION__);
if (!driver->probe) if (!driver->probe)
return error; return error;
if (!try_module_get(driver->owner)) if (!try_module_get(driver->owner)) {
err ("Can't get a module reference for %s", driver->name);
return error; return error;
}
id = usb_match_id (intf, driver->id_table); id = usb_match_id (intf, driver->id_table);
if (id) { if (id) {
...@@ -97,7 +98,7 @@ int usb_device_probe(struct device *dev) ...@@ -97,7 +98,7 @@ int usb_device_probe(struct device *dev)
if (!error) if (!error)
intf->driver = driver; intf->driver = driver;
put_module(driver->owner); module_put(driver->owner);
return error; return error;
} }
...@@ -106,7 +107,6 @@ int usb_device_remove(struct device *dev) ...@@ -106,7 +107,6 @@ int usb_device_remove(struct device *dev)
{ {
struct usb_interface *intf; struct usb_interface *intf;
struct usb_driver *driver; struct usb_driver *driver;
int m;
intf = list_entry(dev,struct usb_interface,dev); intf = list_entry(dev,struct usb_interface,dev);
driver = to_usb_driver(dev->driver); driver = to_usb_driver(dev->driver);
...@@ -117,8 +117,7 @@ int usb_device_remove(struct device *dev) ...@@ -117,8 +117,7 @@ int usb_device_remove(struct device *dev)
return -ENODEV; return -ENODEV;
} }
m = try_module_get(driver->owner); if (!try_module_get(driver->owner)) {
if (m == 0) {
// FIXME this happens even when we just rmmod // FIXME this happens even when we just rmmod
// drivers that aren't in active use... // drivers that aren't in active use...
err("Dieing driver still bound to device.\n"); err("Dieing driver still bound to device.\n");
...@@ -138,7 +137,7 @@ int usb_device_remove(struct device *dev) ...@@ -138,7 +137,7 @@ 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) 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