[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>
This commit is contained in:
Jayachandran C 2006-04-03 12:31:53 -07:00 committed by Greg Kroah-Hartman
parent d4d7e5dffc
commit a14388904c

View file

@ -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) {