aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-20 17:39:53 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-20 17:39:53 -0700
commita4cfae13cef6a700a04b13ba1d819c0641b1b26f (patch)
tree91aa4f8be6df4494276d1a064d9f8f2b994aa367 /drivers
parentbe883da7594b0a2a02074e683673ae0e522566a4 (diff)
parentff7512e1a2a3504649d3716a757f43807b6d26ef (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [ATM]: fix broken uses of NIPQUAD in net/atm [SCTP]: sctp_unpack_cookie() fix [SCTP]: Fix unintentional change to SCTP_ASSERT when !SCTP_DEBUG [NET]: Prevent multiple qdisc runs [CONNECTOR]: Initialize subsystem earlier. [NETFILTER]: xt_sctp: fix endless loop caused by 0 chunk length
Diffstat (limited to 'drivers')
-rw-r--r--drivers/connector/connector.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 35897079a78..79d581c8652 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -308,6 +308,9 @@ int cn_add_callback(struct cb_id *id, char *name, void (*callback)(void *))
int err;
struct cn_dev *dev = &cdev;
+ if (!cn_already_initialized)
+ return -EAGAIN;
+
err = cn_queue_add_callback(dev->cbdev, name, id, callback);
if (err)
return err;
@@ -435,7 +438,7 @@ static void cn_callback(void *data)
mutex_unlock(&notify_lock);
}
-static int __init cn_init(void)
+static int __devinit cn_init(void)
{
struct cn_dev *dev = &cdev;
int err;
@@ -456,21 +459,22 @@ static int __init cn_init(void)
sock_release(dev->nls->sk_socket);
return -EINVAL;
}
+
+ cn_already_initialized = 1;
err = cn_add_callback(&dev->id, "connector", &cn_callback);
if (err) {
+ cn_already_initialized = 0;
cn_queue_free_dev(dev->cbdev);
if (dev->nls->sk_socket)
sock_release(dev->nls->sk_socket);
return -EINVAL;
}
- cn_already_initialized = 1;
-
return 0;
}
-static void __exit cn_fini(void)
+static void __devexit cn_fini(void)
{
struct cn_dev *dev = &cdev;
@@ -482,7 +486,7 @@ static void __exit cn_fini(void)
sock_release(dev->nls->sk_socket);
}
-module_init(cn_init);
+subsys_initcall(cn_init);
module_exit(cn_fini);
EXPORT_SYMBOL_GPL(cn_add_callback);