Commit 4ca5224f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

aoe: fix sysfs_create_file warnings

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a12c93f0
...@@ -63,21 +63,26 @@ static struct disk_attribute disk_attr_fwver = { ...@@ -63,21 +63,26 @@ static struct disk_attribute disk_attr_fwver = {
.show = aoedisk_show_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) aoedisk_add_sysfs(struct aoedev *d)
{ {
sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr); return sysfs_create_group(&d->gd->kobj, &attr_group);
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);
} }
void void
aoedisk_rm_sysfs(struct aoedev *d) aoedisk_rm_sysfs(struct aoedev *d)
{ {
sysfs_remove_link(&d->gd->kobj, "state"); sysfs_remove_group(&d->gd->kobj, &attr_group);
sysfs_remove_link(&d->gd->kobj, "mac");
sysfs_remove_link(&d->gd->kobj, "netif");
sysfs_remove_link(&d->gd->kobj, "firmware-version");
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment