提交 a1438890 编写于 作者: J Jayachandran C 提交者: Greg Kroah-Hartman

[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: NJayachandran C. <c.jayachandran@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d4d7e5df
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册