aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/base.h4
-rw-r--r--drivers/base/class.c4
-rw-r--r--drivers/base/core.c8
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 586c4ca70252..670b95a1a510 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -43,7 +43,7 @@ struct driver_private {
43 * @subsys - the struct kset that defines this class. This is the main kobject 43 * @subsys - the struct kset that defines this class. This is the main kobject
44 * @children - list of class_devices associated with this class 44 * @children - list of class_devices associated with this class
45 * @class_devices - list of devices associated with this class 45 * @class_devices - list of devices associated with this class
46 * @interfaces - list of class_interfaces associated with this class 46 * @class_interfaces - list of class_interfaces associated with this class
47 * @class_dirs - 47 * @class_dirs -
48 * @sem - semaphore to protect the children, devices, and interfaces lists. 48 * @sem - semaphore to protect the children, devices, and interfaces lists.
49 * @class - pointer back to the struct class that this structure is associated 49 * @class - pointer back to the struct class that this structure is associated
@@ -56,7 +56,7 @@ struct driver_private {
56struct class_private { 56struct class_private {
57 struct kset subsys; 57 struct kset subsys;
58 struct list_head class_devices; 58 struct list_head class_devices;
59 struct list_head interfaces; 59 struct list_head class_interfaces;
60 struct kset class_dirs; 60 struct kset class_dirs;
61 struct semaphore sem; 61 struct semaphore sem;
62 struct class *class; 62 struct class *class;
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 9947560def65..48b518e66bfc 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -144,7 +144,7 @@ int class_register(struct class *cls)
144 if (!cp) 144 if (!cp)
145 return -ENOMEM; 145 return -ENOMEM;
146 INIT_LIST_HEAD(&cp->class_devices); 146 INIT_LIST_HEAD(&cp->class_devices);
147 INIT_LIST_HEAD(&cp->interfaces); 147 INIT_LIST_HEAD(&cp->class_interfaces);
148 kset_init(&cp->class_dirs); 148 kset_init(&cp->class_dirs);
149 init_MUTEX(&cp->sem); 149 init_MUTEX(&cp->sem);
150 error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name); 150 error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name);
@@ -372,7 +372,7 @@ int class_interface_register(struct class_interface *class_intf)
372 return -EINVAL; 372 return -EINVAL;
373 373
374 down(&parent->p->sem); 374 down(&parent->p->sem);
375 list_add_tail(&class_intf->node, &parent->p->interfaces); 375 list_add_tail(&class_intf->node, &parent->p->class_interfaces);
376 if (class_intf->add_dev) { 376 if (class_intf->add_dev) {
377 list_for_each_entry(dev, &parent->p->class_devices, node) 377 list_for_each_entry(dev, &parent->p->class_devices, node)
378 class_intf->add_dev(dev, class_intf); 378 class_intf->add_dev(dev, class_intf);
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 52d1e71f2a4c..76fdd41fea0e 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -909,8 +909,8 @@ int device_add(struct device *dev)
909 list_add_tail(&dev->node, &dev->class->p->class_devices); 909 list_add_tail(&dev->node, &dev->class->p->class_devices);
910 910
911 /* notify any interfaces that the device is here */ 911 /* notify any interfaces that the device is here */
912 list_for_each_entry(class_intf, &dev->class->p->interfaces, 912 list_for_each_entry(class_intf,
913 node) 913 &dev->class->p->class_interfaces, node)
914 if (class_intf->add_dev) 914 if (class_intf->add_dev)
915 class_intf->add_dev(dev, class_intf); 915 class_intf->add_dev(dev, class_intf);
916 up(&dev->class->p->sem); 916 up(&dev->class->p->sem);
@@ -1016,8 +1016,8 @@ void device_del(struct device *dev)
1016 1016
1017 down(&dev->class->p->sem); 1017 down(&dev->class->p->sem);
1018 /* notify any interfaces that the device is now gone */ 1018 /* notify any interfaces that the device is now gone */
1019 list_for_each_entry(class_intf, &dev->class->p->interfaces, 1019 list_for_each_entry(class_intf,
1020 node) 1020 &dev->class->p->class_interfaces, node)
1021 if (class_intf->remove_dev) 1021 if (class_intf->remove_dev)
1022 class_intf->remove_dev(dev, class_intf); 1022 class_intf->remove_dev(dev, class_intf);
1023 /* remove the device from the class list */ 1023 /* remove the device from the class list */