]> err.no Git - linux-2.6/commitdiff
aoe: fix sysfs_create_file warnings
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 9 Apr 2002 19:14:34 +0000 (12:14 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 18 Oct 2006 19:53:51 +0000 (12:53 -0700)
Moved the attributes into a group, making the compiler be quiet about
ignoring the return value of the file create calls.  This also also
fixed a bug when removing the files, which were not symlinks.

Cc: "Ed L. Cashin" <ecashin@coraid.com>
Cc: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/block/aoe/aoeblk.c

index 4259b52b01e2639143a3cc6965221ca6ef9c55b4..d433f27e0ce2529c1617a6584e42abe55be62d36 100644 (file)
@@ -63,21 +63,26 @@ static struct disk_attribute disk_attr_fwver = {
        .show = aoedisk_show_fwver
 };
 
-static void
+static struct attribute *aoe_attrs[] = {
+       &disk_attr_state.attr,
+       &disk_attr_mac.attr,
+       &disk_attr_netif.attr,
+       &disk_attr_fwver.attr,
+};
+
+static const struct attribute_group attr_group = {
+       .attrs = aoe_attrs,
+};
+
+static int
 aoedisk_add_sysfs(struct aoedev *d)
 {
-       sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr);
-       sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr);
-       sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr);
-       sysfs_create_file(&d->gd->kobj, &disk_attr_fwver.attr);
+       return sysfs_create_group(&d->gd->kobj, &attr_group);
 }
 void
 aoedisk_rm_sysfs(struct aoedev *d)
 {
-       sysfs_remove_link(&d->gd->kobj, "state");
-       sysfs_remove_link(&d->gd->kobj, "mac");
-       sysfs_remove_link(&d->gd->kobj, "netif");
-       sysfs_remove_link(&d->gd->kobj, "firmware-version");
+       sysfs_remove_group(&d->gd->kobj, &attr_group);
 }
 
 static int