]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Driver Core: Move virtual_device_parent() to core.c
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 23 Oct 2006 17:40:54 +0000 (10:40 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Dec 2006 22:51:58 +0000 (14:51 -0800)
It doesn't need to be global or in device.h

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/class.c
drivers/base/core.c
include/linux/device.h

index 0ff267a248dba8ff5e215a380a54ea0f4221c7ce..2e705f6abb4c39420243f561c7520d16c8026f9f 100644 (file)
@@ -893,23 +893,6 @@ void class_interface_unregister(struct class_interface *class_intf)
        class_put(parent);
 }
 
-int virtual_device_parent(struct device *dev)
-{
-       if (!dev->class)
-               return -ENODEV;
-
-       if (!dev->class->virtual_dir) {
-               static struct kobject *virtual_dir = NULL;
-
-               if (!virtual_dir)
-                       virtual_dir = kobject_add_dir(&devices_subsys.kset.kobj, "virtual");
-               dev->class->virtual_dir = kobject_add_dir(virtual_dir, dev->class->name);
-       }
-
-       dev->kobj.parent = dev->class->virtual_dir;
-       return 0;
-}
-
 int __init classes_init(void)
 {
        int retval;
index d4f35d8902a275b308b0599aa491de7fc302a9cc..dbcd40b987d22764317aec8f82aa34f2983c4df5 100644 (file)
@@ -384,6 +384,23 @@ void device_initialize(struct device *dev)
        device_init_wakeup(dev, 0);
 }
 
+static int virtual_device_parent(struct device *dev)
+{
+       if (!dev->class)
+               return -ENODEV;
+
+       if (!dev->class->virtual_dir) {
+               static struct kobject *virtual_dir = NULL;
+
+               if (!virtual_dir)
+                       virtual_dir = kobject_add_dir(&devices_subsys.kset.kobj, "virtual");
+               dev->class->virtual_dir = kobject_add_dir(virtual_dir, dev->class->name);
+       }
+
+       dev->kobj.parent = dev->class->virtual_dir;
+       return 0;
+}
+
 /**
  *     device_add - add device to device hierarchy.
  *     @dev:   device.
index b00e027113930900956afe2902b54422088f6c37..00b29e0c5ce0fc62345bd17652cc9198ca30453f 100644 (file)
@@ -440,8 +440,6 @@ extern struct device *device_create(struct class *cls, struct device *parent,
                                    __attribute__((format(printf,4,5)));
 extern void device_destroy(struct class *cls, dev_t devt);
 
-extern int virtual_device_parent(struct device *dev);
-
 /*
  * Platform "fixup" functions - allow the platform to have their say
  * about devices and actions that the general device layer doesn't