Skip to content

Commit

Permalink
[SCSI] attirbute_container: Initialize sysfs attributes with sysfs_at…
Browse files Browse the repository at this point in the history
…tr_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>
  • Loading branch information
James Bottomley authored and James Bottomley committed Mar 27, 2010
1 parent cf74744 commit ebd09ec
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/base/attribute_container.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ebd09ec

Please sign in to comment.