Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e32cc7366d88eeba12d22272a73dd83fb570ccb0
Commit:     e32cc7366d88eeba12d22272a73dd83fb570ccb0
Parent:     1eada11c88251e0a30ce5690d2607bb4293b3564
Author:     Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 17 23:05:35 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jan 24 20:40:31 2008 -0800

    Kobject: convert net/bridge/br_if.c to use kobject_init/add_ng()
    
    This converts the code to use the new kobject functions, cleaning up the
    logic in doing so.
    
    Cc: Stephen Hemminger <[EMAIL PROTECTED]>
    Cc: Kay Sievers <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 net/bridge/br_if.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index dadec94..298e0f4 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -258,12 +258,6 @@ static struct net_bridge_port *new_nbp(struct net_bridge 
*br,
        p->state = BR_STATE_DISABLED;
        br_stp_port_timer_init(p);
 
-       kobject_init(&p->kobj);
-       kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR);
-       p->kobj.ktype = &brport_ktype;
-       p->kobj.parent = &(dev->dev.kobj);
-       p->kobj.kset = NULL;
-
        return p;
 }
 
@@ -379,7 +373,8 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
        if (IS_ERR(p))
                return PTR_ERR(p);
 
-       err = kobject_add(&p->kobj);
+       err = kobject_init_and_add(&p->kobj, &brport_ktype, &(dev->dev.kobj),
+                                  SYSFS_BRIDGE_PORT_ATTR);
        if (err)
                goto err0;
 
@@ -416,6 +411,7 @@ err2:
        br_fdb_delete_by_port(br, p, 1);
 err1:
        kobject_del(&p->kobj);
+       return err;
 err0:
        kobject_put(&p->kobj);
        return err;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to