Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init
authorDenis Cheng <crquan@gmail.com>
Wed, 5 Dec 2007 18:24:40 +0000 (02:24 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Jan 2008 04:40:41 +0000 (20:40 -0800)
LIST_HEAD has been widely used, so switch to this simpler method.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/attribute_container.c
drivers/base/base.h
drivers/base/init.c

index 7370d7cf59888050d374d7a48a03185a06f0df7c..d4dfb97de3b006a20caaf705e33c0d78a80a82fe 100644 (file)
@@ -61,7 +61,7 @@ attribute_container_classdev_to_container(struct class_device *classdev)
 }
 EXPORT_SYMBOL_GPL(attribute_container_classdev_to_container);
 
-static struct list_head attribute_container_list;
+static LIST_HEAD(attribute_container_list);
 
 static DEFINE_MUTEX(attribute_container_mutex);
 
@@ -429,10 +429,3 @@ attribute_container_find_class_device(struct attribute_container *cont,
        return cdev;
 }
 EXPORT_SYMBOL_GPL(attribute_container_find_class_device);
-
-int __init
-attribute_container_init(void)
-{
-       INIT_LIST_HEAD(&attribute_container_list);
-       return 0;
-}
index 3b0f395552db3f5387ebecc972497b7a33e07937..a74ceda34e194175c23c9b1afb4381cc1dd7243d 100644 (file)
@@ -49,7 +49,6 @@ static inline int hypervisor_init(void) { return 0; }
 extern int platform_bus_init(void);
 extern int system_bus_init(void);
 extern int cpu_dev_init(void);
-extern int attribute_container_init(void);
 
 extern int bus_add_device(struct device * dev);
 extern void bus_attach_device(struct device * dev);
index 37138154f9e824b353f322022ba8c41017ae3c3e..1da88a10cfec1633b7498ab8fead995d6090becf 100644 (file)
@@ -36,5 +36,4 @@ void __init driver_init(void)
        system_bus_init();
        cpu_dev_init();
        memory_dev_init();
-       attribute_container_init();
 }