sysfs: fix sysfs lockdep warning in ipmi code
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Mar 2010 20:59:51 +0000 (13:59 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 19 Mar 2010 14:12:12 +0000 (07:12 -0700)
This fixes a sysfs lockdep warning in the ipmi code.

Thanks to Eric Biederman and Yinghai Lu for the original versions of the
patch, unfortunatly they did not submit them in a form they could be
applied in.

Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Eric Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/ipmi/ipmi_msghandler.c

index ec5e3f8df648ba1e719836a9b8349246005ba685..c6ad4234378d7e5cd0818d839e81c3b641e1d426 100644 (file)
@@ -2272,42 +2272,52 @@ static int create_files(struct bmc_device *bmc)
        bmc->device_id_attr.attr.name = "device_id";
        bmc->device_id_attr.attr.mode = S_IRUGO;
        bmc->device_id_attr.show = device_id_show;
+       sysfs_attr_init(&bmc->device_id_attr.attr);
 
        bmc->provides_dev_sdrs_attr.attr.name = "provides_device_sdrs";
        bmc->provides_dev_sdrs_attr.attr.mode = S_IRUGO;
        bmc->provides_dev_sdrs_attr.show = provides_dev_sdrs_show;
+       sysfs_attr_init(&bmc->provides_dev_sdrs_attr.attr);
 
        bmc->revision_attr.attr.name = "revision";
        bmc->revision_attr.attr.mode = S_IRUGO;
        bmc->revision_attr.show = revision_show;
+       sysfs_attr_init(&bmc->revision_attr.attr);
 
        bmc->firmware_rev_attr.attr.name = "firmware_revision";
        bmc->firmware_rev_attr.attr.mode = S_IRUGO;
        bmc->firmware_rev_attr.show = firmware_rev_show;
+       sysfs_attr_init(&bmc->firmware_rev_attr.attr);
 
        bmc->version_attr.attr.name = "ipmi_version";
        bmc->version_attr.attr.mode = S_IRUGO;
        bmc->version_attr.show = ipmi_version_show;
+       sysfs_attr_init(&bmc->version_attr.attr);
 
        bmc->add_dev_support_attr.attr.name = "additional_device_support";
        bmc->add_dev_support_attr.attr.mode = S_IRUGO;
        bmc->add_dev_support_attr.show = add_dev_support_show;
+       sysfs_attr_init(&bmc->add_dev_support_attr.attr);
 
        bmc->manufacturer_id_attr.attr.name = "manufacturer_id";
        bmc->manufacturer_id_attr.attr.mode = S_IRUGO;
        bmc->manufacturer_id_attr.show = manufacturer_id_show;
+       sysfs_attr_init(&bmc->manufacturer_id_attr.attr);
 
        bmc->product_id_attr.attr.name = "product_id";
        bmc->product_id_attr.attr.mode = S_IRUGO;
        bmc->product_id_attr.show = product_id_show;
+       sysfs_attr_init(&bmc->product_id_attr.attr);
 
        bmc->guid_attr.attr.name = "guid";
        bmc->guid_attr.attr.mode = S_IRUGO;
        bmc->guid_attr.show = guid_show;
+       sysfs_attr_init(&bmc->guid_attr.attr);
 
        bmc->aux_firmware_rev_attr.attr.name = "aux_firmware_revision";
        bmc->aux_firmware_rev_attr.attr.mode = S_IRUGO;
        bmc->aux_firmware_rev_attr.show = aux_firmware_rev_show;
+       sysfs_attr_init(&bmc->aux_firmware_rev_attr.attr);
 
        err = device_create_file(&bmc->dev->dev,
                           &bmc->device_id_attr);