diff options
author | Jayachandran C <jchandra@digeo.com> | 2006-04-03 15:31:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-04-14 14:41:24 -0400 |
commit | a14388904ca67197c9a531dba2358d8131697865 (patch) | |
tree | fc4b31f3588e2f0b308c84e905ce9af7faea443e /drivers/base/class.c | |
parent | d4d7e5dffc4844ef51fe11f497bd774c04413a00 (diff) |
[PATCH] driver core: fix unnecessary NULL check in drivers/base/class.c
This patch tries to fix an issue in drivers/base/class.c, please
review and apply if correct.
Patch Description:
"parent_class" is checked for NULL already, so removed the unnecessary
check.
Signed-off-by: Jayachandran C. <c.jayachandran@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r-- | drivers/base/class.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index df7fdabd0730..0e71dff327cd 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -562,14 +562,13 @@ int class_device_add(struct class_device *class_dev) | |||
562 | kobject_uevent(&class_dev->kobj, KOBJ_ADD); | 562 | kobject_uevent(&class_dev->kobj, KOBJ_ADD); |
563 | 563 | ||
564 | /* notify any interfaces this device is now here */ | 564 | /* notify any interfaces this device is now here */ |
565 | if (parent_class) { | 565 | down(&parent_class->sem); |
566 | down(&parent_class->sem); | 566 | list_add_tail(&class_dev->node, &parent_class->children); |
567 | list_add_tail(&class_dev->node, &parent_class->children); | 567 | list_for_each_entry(class_intf, &parent_class->interfaces, node) { |
568 | list_for_each_entry(class_intf, &parent_class->interfaces, node) | 568 | if (class_intf->add) |
569 | if (class_intf->add) | 569 | class_intf->add(class_dev, class_intf); |
570 | class_intf->add(class_dev, class_intf); | ||
571 | up(&parent_class->sem); | ||
572 | } | 570 | } |
571 | up(&parent_class->sem); | ||
573 | 572 | ||
574 | register_done: | 573 | register_done: |
575 | if (error) { | 574 | if (error) { |