Move call to kobject_hotplug() above code that adds interfaces
to a class device, otherwise children's hotplug events may reach
userspace first.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
                                  class_name);
        }
 
+       kobject_hotplug(&class_dev->kobj, KOBJ_ADD);
+
        /* notify any interfaces this device is now here */
        if (parent) {
                down(&parent->sem);
                                class_intf->add(class_dev);
                up(&parent->sem);
        }
-       kobject_hotplug(&class_dev->kobj, KOBJ_ADD);
 
  register_done:
        if (error && parent)