summaryrefslogtreecommitdiff
path: root/net/bridge/br_sysfs_br.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-17 15:54:39 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 20:40:26 -0800
commit43b98c4a66760d18d4056beed4078a8dbad193cc (patch)
treeb460b72801ca02295d13551e64269d1a8a841a34 /net/bridge/br_sysfs_br.c
parent81e7c6a636c81d9eeaeaa732bfbace44535fab00 (diff)
Kobject: change net/bridge to use kobject_create_and_add
The kobject in the bridge code is only used for registering with sysfs, not for any lifespan rules. This patch changes it to be only a pointer and use the simpler api for this kind of thing. Cc: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/bridge/br_sysfs_br.c')
-rw-r--r--net/bridge/br_sysfs_br.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 3312e8f2abe4..4e7f91fafedd 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -426,16 +426,10 @@ int br_sysfs_addbr(struct net_device *dev)
goto out2;
}
-
- kobject_set_name(&br->ifobj, SYSFS_BRIDGE_PORT_SUBDIR);
- br->ifobj.ktype = NULL;
- br->ifobj.kset = NULL;
- br->ifobj.parent = brobj;
-
- err = kobject_register(&br->ifobj);
- if (err) {
+ br->ifobj = kobject_create_and_add(SYSFS_BRIDGE_PORT_SUBDIR, brobj);
+ if (!br->ifobj) {
pr_info("%s: can't add kobject (directory) %s/%s\n",
- __FUNCTION__, dev->name, kobject_name(&br->ifobj));
+ __FUNCTION__, dev->name, SYSFS_BRIDGE_PORT_SUBDIR);
goto out3;
}
return 0;
@@ -453,7 +447,7 @@ void br_sysfs_delbr(struct net_device *dev)
struct kobject *kobj = &dev->dev.kobj;
struct net_bridge *br = netdev_priv(dev);
- kobject_unregister(&br->ifobj);
+ kobject_unregister(br->ifobj);
sysfs_remove_bin_file(kobj, &bridge_forward);
sysfs_remove_group(kobj, &bridge_group);
}