Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130305
b: refs/heads/master
c: 501950d
h: refs/heads/master
i:
  130303: 28db0b7
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jan 28, 2009
1 parent 008a228 commit 50b4f01
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a15d95a003fae154121733f049dd25e9c13dbef3
refs/heads/master: 501950d846218ed80a776d2aae5aed9c8b92e778
20 changes: 12 additions & 8 deletions trunk/drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,7 @@ const struct file_operations usbdev_file_operations = {
.release = usbdev_release,
};

void usb_fs_classdev_common_remove(struct usb_device *udev)
static void usbdev_remove(struct usb_device *udev)
{
struct dev_state *ps;
struct siginfo sinfo;
Expand Down Expand Up @@ -1742,10 +1742,15 @@ static void usb_classdev_remove(struct usb_device *dev)
{
if (dev->usb_classdev)
device_unregister(dev->usb_classdev);
usb_fs_classdev_common_remove(dev);
}

static int usb_classdev_notify(struct notifier_block *self,
#else
#define usb_classdev_add(dev) 0
#define usb_classdev_remove(dev) do {} while (0)

#endif

static int usbdev_notify(struct notifier_block *self,
unsigned long action, void *dev)
{
switch (action) {
Expand All @@ -1755,15 +1760,15 @@ static int usb_classdev_notify(struct notifier_block *self,
break;
case USB_DEVICE_REMOVE:
usb_classdev_remove(dev);
usbdev_remove(dev);
break;
}
return NOTIFY_OK;
}

static struct notifier_block usbdev_nb = {
.notifier_call = usb_classdev_notify,
.notifier_call = usbdev_notify,
};
#endif

static struct cdev usb_device_cdev;

Expand Down Expand Up @@ -1798,9 +1803,8 @@ int __init usb_devio_init(void)
* to /sys/dev
*/
usb_classdev_class->dev_kobj = NULL;

usb_register_notify(&usbdev_nb);
#endif
usb_register_notify(&usbdev_nb);
out:
return retval;

Expand All @@ -1811,8 +1815,8 @@ int __init usb_devio_init(void)

void usb_devio_cleanup(void)
{
#ifdef CONFIG_USB_DEVICE_CLASS
usb_unregister_notify(&usbdev_nb);
#ifdef CONFIG_USB_DEVICE_CLASS
class_destroy(usb_classdev_class);
#endif
cdev_del(&usb_device_cdev);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/usb/core/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ static void usbfs_remove_device(struct usb_device *dev)
fs_remove_file (dev->usbfs_dentry);
dev->usbfs_dentry = NULL;
}
usb_fs_classdev_common_remove(dev);
}

static int usbfs_notify(struct notifier_block *self, unsigned long action, void *dev)
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/usb/core/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ extern struct usb_driver usbfs_driver;
extern const struct file_operations usbfs_devices_fops;
extern const struct file_operations usbdev_file_operations;
extern void usbfs_conn_disc_event(void);
extern void usb_fs_classdev_common_remove(struct usb_device *udev);

extern int usb_devio_init(void);
extern void usb_devio_cleanup(void);
Expand Down

0 comments on commit 50b4f01

Please sign in to comment.