|
@@ -1700,7 +1700,7 @@ const struct file_operations usbdev_file_operations = {
|
|
.release = usbdev_release,
|
|
.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 dev_state *ps;
|
|
struct siginfo sinfo;
|
|
struct siginfo sinfo;
|
|
@@ -1742,10 +1742,15 @@ static void usb_classdev_remove(struct usb_device *dev)
|
|
{
|
|
{
|
|
if (dev->usb_classdev)
|
|
if (dev->usb_classdev)
|
|
device_unregister(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)
|
|
unsigned long action, void *dev)
|
|
{
|
|
{
|
|
switch (action) {
|
|
switch (action) {
|
|
@@ -1755,15 +1760,15 @@ static int usb_classdev_notify(struct notifier_block *self,
|
|
break;
|
|
break;
|
|
case USB_DEVICE_REMOVE:
|
|
case USB_DEVICE_REMOVE:
|
|
usb_classdev_remove(dev);
|
|
usb_classdev_remove(dev);
|
|
|
|
+ usbdev_remove(dev);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
return NOTIFY_OK;
|
|
return NOTIFY_OK;
|
|
}
|
|
}
|
|
|
|
|
|
static struct notifier_block usbdev_nb = {
|
|
static struct notifier_block usbdev_nb = {
|
|
- .notifier_call = usb_classdev_notify,
|
|
|
|
|
|
+ .notifier_call = usbdev_notify,
|
|
};
|
|
};
|
|
-#endif
|
|
|
|
|
|
|
|
static struct cdev usb_device_cdev;
|
|
static struct cdev usb_device_cdev;
|
|
|
|
|
|
@@ -1798,9 +1803,8 @@ int __init usb_devio_init(void)
|
|
* to /sys/dev
|
|
* to /sys/dev
|
|
*/
|
|
*/
|
|
usb_classdev_class->dev_kobj = NULL;
|
|
usb_classdev_class->dev_kobj = NULL;
|
|
-
|
|
|
|
- usb_register_notify(&usbdev_nb);
|
|
|
|
#endif
|
|
#endif
|
|
|
|
+ usb_register_notify(&usbdev_nb);
|
|
out:
|
|
out:
|
|
return retval;
|
|
return retval;
|
|
|
|
|
|
@@ -1811,8 +1815,8 @@ error_cdev:
|
|
|
|
|
|
void usb_devio_cleanup(void)
|
|
void usb_devio_cleanup(void)
|
|
{
|
|
{
|
|
-#ifdef CONFIG_USB_DEVICE_CLASS
|
|
|
|
usb_unregister_notify(&usbdev_nb);
|
|
usb_unregister_notify(&usbdev_nb);
|
|
|
|
+#ifdef CONFIG_USB_DEVICE_CLASS
|
|
class_destroy(usb_classdev_class);
|
|
class_destroy(usb_classdev_class);
|
|
#endif
|
|
#endif
|
|
cdev_del(&usb_device_cdev);
|
|
cdev_del(&usb_device_cdev);
|