summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorJayachandran C <jchandra@digeo.com>2006-04-03 12:31:53 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-04-14 11:41:24 -0700
commita14388904ca67197c9a531dba2358d8131697865 (patch)
treefc4b31f3588e2f0b308c84e905ce9af7faea443e /drivers/base
parentd4d7e5dffc4844ef51fe11f497bd774c04413a00 (diff)
downloadlinux-stable-a14388904ca67197c9a531dba2358d8131697865.tar.gz
linux-stable-a14388904ca67197c9a531dba2358d8131697865.tar.bz2
linux-stable-a14388904ca67197c9a531dba2358d8131697865.zip
[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')
-rw-r--r--drivers/base/class.c13
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)
kobject_uevent(&class_dev->kobj, KOBJ_ADD);
/* notify any interfaces this device is now here */
- if (parent_class) {
- down(&parent_class->sem);
- list_add_tail(&class_dev->node, &parent_class->children);
- list_for_each_entry(class_intf, &parent_class->interfaces, node)
- if (class_intf->add)
- class_intf->add(class_dev, class_intf);
- up(&parent_class->sem);
+ down(&parent_class->sem);
+ list_add_tail(&class_dev->node, &parent_class->children);
+ list_for_each_entry(class_intf, &parent_class->interfaces, node) {
+ if (class_intf->add)
+ class_intf->add(class_dev, class_intf);
}
+ up(&parent_class->sem);
register_done:
if (error) {