浏览代码

[SCSI] attirbute_container: Initialize sysfs attributes with sysfs_attr_init

All of the SCSI transport classes are suddenly spitting lockdep
warnings.  According to Eric Biderman this is because lockdep needs
static initialisers and the attribute container way of doing things
end up with dynamic sysfs attributes.  Fix this by calling
sysfs_attr_init which sets the lockdep key correctly.

Tested-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
James Bottomley 15 年之前
父节点
当前提交
ebd09ec93c
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/base/attribute_container.c

+ 1 - 0
drivers/base/attribute_container.c

@@ -328,6 +328,7 @@ attribute_container_add_attrs(struct device *classdev)
 		return sysfs_create_group(&classdev->kobj, cont->grp);
 
 	for (i = 0; attrs[i]; i++) {
+		sysfs_attr_init(&attrs[i]->attr);
 		error = device_create_file(classdev, attrs[i]);
 		if (error)
 			return error;