diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-09-15 03:01:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 12:52:51 -0400 |
commit | d8539d81aeee4dbdc0624a798321e822fb2df7ae (patch) | |
tree | 3fc46e80f2fdec0a7ca714dfa3fb8f08648d3bb8 /drivers/base | |
parent | 7bd7b091429705eb281d60c553cc643aada8045a (diff) |
[PATCH] Driver core: pass interface to class interface methods
Driver core: pass interface to class intreface methods
Pass interface as argument to add() and remove() class interface
methods. This way a subsystem can implement generic add/remove
handlers and then call interface-specific ones.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/class.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index 8df58c57dd2..73d44cf53db 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -532,7 +532,7 @@ int class_device_add(struct class_device *class_dev) | |||
532 | list_add_tail(&class_dev->node, &parent->children); | 532 | list_add_tail(&class_dev->node, &parent->children); |
533 | list_for_each_entry(class_intf, &parent->interfaces, node) | 533 | list_for_each_entry(class_intf, &parent->interfaces, node) |
534 | if (class_intf->add) | 534 | if (class_intf->add) |
535 | class_intf->add(class_dev); | 535 | class_intf->add(class_dev, class_intf); |
536 | up(&parent->sem); | 536 | up(&parent->sem); |
537 | } | 537 | } |
538 | 538 | ||
@@ -612,7 +612,7 @@ void class_device_del(struct class_device *class_dev) | |||
612 | list_del_init(&class_dev->node); | 612 | list_del_init(&class_dev->node); |
613 | list_for_each_entry(class_intf, &parent->interfaces, node) | 613 | list_for_each_entry(class_intf, &parent->interfaces, node) |
614 | if (class_intf->remove) | 614 | if (class_intf->remove) |
615 | class_intf->remove(class_dev); | 615 | class_intf->remove(class_dev, class_intf); |
616 | up(&parent->sem); | 616 | up(&parent->sem); |
617 | } | 617 | } |
618 | 618 | ||
@@ -729,7 +729,7 @@ int class_interface_register(struct class_interface *class_intf) | |||
729 | list_add_tail(&class_intf->node, &parent->interfaces); | 729 | list_add_tail(&class_intf->node, &parent->interfaces); |
730 | if (class_intf->add) { | 730 | if (class_intf->add) { |
731 | list_for_each_entry(class_dev, &parent->children, node) | 731 | list_for_each_entry(class_dev, &parent->children, node) |
732 | class_intf->add(class_dev); | 732 | class_intf->add(class_dev, class_intf); |
733 | } | 733 | } |
734 | up(&parent->sem); | 734 | up(&parent->sem); |
735 | 735 | ||
@@ -748,7 +748,7 @@ void class_interface_unregister(struct class_interface *class_intf) | |||
748 | list_del_init(&class_intf->node); | 748 | list_del_init(&class_intf->node); |
749 | if (class_intf->remove) { | 749 | if (class_intf->remove) { |
750 | list_for_each_entry(class_dev, &parent->children, node) | 750 | list_for_each_entry(class_dev, &parent->children, node) |
751 | class_intf->remove(class_dev); | 751 | class_intf->remove(class_dev, class_intf); |
752 | } | 752 | } |
753 | up(&parent->sem); | 753 | up(&parent->sem); |
754 | 754 | ||