aboutsummaryrefslogtreecommitdiff
path: root/net/atm/resources.c
diff options
context:
space:
mode:
authorRoman Kagan <rkagan@mail.ru>2006-06-29 12:36:34 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-29 16:58:19 -0700
commit656d98b09d57d4e1185c5d2436a42600d48fbcb5 (patch)
tree42c8795ea142e6c0a002bcdb26d255e2b8693e4c /net/atm/resources.c
parentd17f086550a6fdb13fe82371d60ebf80904c6f96 (diff)
[ATM]: basic sysfs support for ATM devices
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm/resources.c')
-rw-r--r--net/atm/resources.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/net/atm/resources.c b/net/atm/resources.c
index 18ac80698f8..534baf70405 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -114,14 +114,27 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops,
printk(KERN_ERR "atm_dev_register: "
"atm_proc_dev_register failed for dev %s\n",
type);
- mutex_unlock(&atm_dev_mutex);
- kfree(dev);
- return NULL;
+ goto out_fail;
+ }
+
+ if (atm_register_sysfs(dev) < 0) {
+ printk(KERN_ERR "atm_dev_register: "
+ "atm_register_sysfs failed for dev %s\n",
+ type);
+ atm_proc_dev_deregister(dev);
+ goto out_fail;
}
+
list_add_tail(&dev->dev_list, &atm_devs);
- mutex_unlock(&atm_dev_mutex);
+out:
+ mutex_unlock(&atm_dev_mutex);
return dev;
+
+out_fail:
+ kfree(dev);
+ dev = NULL;
+ goto out;
}
@@ -140,6 +153,7 @@ void atm_dev_deregister(struct atm_dev *dev)
mutex_unlock(&atm_dev_mutex);
atm_dev_release_vccs(dev);
+ atm_unregister_sysfs(dev);
atm_proc_dev_deregister(dev);
atm_dev_put(dev);