aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r--drivers/base/class.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index b80d91cc8c3a..03243d4002fd 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -184,9 +184,9 @@ int __class_register(struct class *cls, struct lock_class_key *key)
184 if (!cp) 184 if (!cp)
185 return -ENOMEM; 185 return -ENOMEM;
186 klist_init(&cp->klist_devices, klist_class_dev_get, klist_class_dev_put); 186 klist_init(&cp->klist_devices, klist_class_dev_get, klist_class_dev_put);
187 INIT_LIST_HEAD(&cp->class_interfaces); 187 INIT_LIST_HEAD(&cp->interfaces);
188 kset_init(&cp->glue_dirs); 188 kset_init(&cp->glue_dirs);
189 __mutex_init(&cp->class_mutex, "struct class mutex", key); 189 __mutex_init(&cp->mutex, "subsys mutex", key);
190 error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name); 190 error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name);
191 if (error) { 191 if (error) {
192 kfree(cp); 192 kfree(cp);
@@ -460,15 +460,15 @@ int class_interface_register(struct class_interface *class_intf)
460 if (!parent) 460 if (!parent)
461 return -EINVAL; 461 return -EINVAL;
462 462
463 mutex_lock(&parent->p->class_mutex); 463 mutex_lock(&parent->p->mutex);
464 list_add_tail(&class_intf->node, &parent->p->class_interfaces); 464 list_add_tail(&class_intf->node, &parent->p->interfaces);
465 if (class_intf->add_dev) { 465 if (class_intf->add_dev) {
466 class_dev_iter_init(&iter, parent, NULL, NULL); 466 class_dev_iter_init(&iter, parent, NULL, NULL);
467 while ((dev = class_dev_iter_next(&iter))) 467 while ((dev = class_dev_iter_next(&iter)))
468 class_intf->add_dev(dev, class_intf); 468 class_intf->add_dev(dev, class_intf);
469 class_dev_iter_exit(&iter); 469 class_dev_iter_exit(&iter);
470 } 470 }
471 mutex_unlock(&parent->p->class_mutex); 471 mutex_unlock(&parent->p->mutex);
472 472
473 return 0; 473 return 0;
474} 474}
@@ -482,7 +482,7 @@ void class_interface_unregister(struct class_interface *class_intf)
482 if (!parent) 482 if (!parent)
483 return; 483 return;
484 484
485 mutex_lock(&parent->p->class_mutex); 485 mutex_lock(&parent->p->mutex);
486 list_del_init(&class_intf->node); 486 list_del_init(&class_intf->node);
487 if (class_intf->remove_dev) { 487 if (class_intf->remove_dev) {
488 class_dev_iter_init(&iter, parent, NULL, NULL); 488 class_dev_iter_init(&iter, parent, NULL, NULL);
@@ -490,7 +490,7 @@ void class_interface_unregister(struct class_interface *class_intf)
490 class_intf->remove_dev(dev, class_intf); 490 class_intf->remove_dev(dev, class_intf);
491 class_dev_iter_exit(&iter); 491 class_dev_iter_exit(&iter);
492 } 492 }
493 mutex_unlock(&parent->p->class_mutex); 493 mutex_unlock(&parent->p->mutex);
494 494
495 class_put(parent); 495 class_put(parent);
496} 496}