driver core: fix device_add error path
authorDmitriy Monakhov <dmonakhov@sw.ru>
Sun, 11 Mar 2007 12:36:19 +0000 (15:36 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 27 Apr 2007 17:57:27 +0000 (10:57 -0700)
 - At the moment we jump here device was't added to
   dev->class->devices list yet.

Signed-off-by: Monakhov Dmitriy <dmonakhov@openvz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/core.c

index d7fcf823a42a71e08af9da4e62d83b0dae5129fd..db3a151be4a18fa4ab5b4e0a4591f7c811f96daa 100644 (file)
@@ -677,15 +677,6 @@ int device_add(struct device *dev)
 #endif
                        sysfs_remove_link(&dev->kobj, "device");
                }
-
-               down(&dev->class->sem);
-               /* notify any interfaces that the device is now gone */
-               list_for_each_entry(class_intf, &dev->class->interfaces, node)
-                       if (class_intf->remove_dev)
-                               class_intf->remove_dev(dev, class_intf);
-               /* remove the device from the class list */
-               list_del_init(&dev->node);
-               up(&dev->class->sem);
        }
  ueventattrError:
        device_remove_file(dev, &dev->uevent_attr);