aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/common.c
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2010-03-14 08:58:05 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-15 19:00:49 -0400
commitbc35b4e347c047fb1c665bb761ddb22482539f7f (patch)
tree4f5b4b1c882b2f36015e0aada78e9307e812a0f9 /drivers/isdn/gigaset/common.c
parent4d823be98c5b24d94c7f41a384a4bb60d7848ad5 (diff)
gigaset: avoid registering CAPI driver more than once
Registering/unregistering the Gigaset CAPI driver when a device is connected/disconnected causes an Oops when disconnecting two Gigaset devices in a row, because the same capi_driver structure gets unregistered twice. Fix by making driver registration/unregistration a separate operation (empty in the ISDN4Linux case) called when the main module is loaded/unloaded. Impact: bugfix Signed-off-by: Tilman Schmidt <tilman@imap.cc> Acked-by: Karsten Keil <keil@b1-systems.de> CC: stable@kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset/common.c')
-rw-r--r--drivers/isdn/gigaset/common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 85de3399a2f2..bdc01cb9f0ab 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -507,7 +507,7 @@ void gigaset_freecs(struct cardstate *cs)
507 case 2: /* error in initcshw */ 507 case 2: /* error in initcshw */
508 /* Deregister from LL */ 508 /* Deregister from LL */
509 make_invalid(cs, VALID_ID); 509 make_invalid(cs, VALID_ID);
510 gigaset_isdn_unregister(cs); 510 gigaset_isdn_unregdev(cs);
511 511
512 /* fall through */ 512 /* fall through */
513 case 1: /* error when registering to LL */ 513 case 1: /* error when registering to LL */
@@ -769,7 +769,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
769 cs->cmdbytes = 0; 769 cs->cmdbytes = 0;
770 770
771 gig_dbg(DEBUG_INIT, "setting up iif"); 771 gig_dbg(DEBUG_INIT, "setting up iif");
772 if (!gigaset_isdn_register(cs, modulename)) { 772 if (!gigaset_isdn_regdev(cs, modulename)) {
773 pr_err("error registering ISDN device\n"); 773 pr_err("error registering ISDN device\n");
774 goto error; 774 goto error;
775 } 775 }
@@ -1205,11 +1205,13 @@ static int __init gigaset_init_module(void)
1205 gigaset_debuglevel = DEBUG_DEFAULT; 1205 gigaset_debuglevel = DEBUG_DEFAULT;
1206 1206
1207 pr_info(DRIVER_DESC DRIVER_DESC_DEBUG "\n"); 1207 pr_info(DRIVER_DESC DRIVER_DESC_DEBUG "\n");
1208 gigaset_isdn_regdrv();
1208 return 0; 1209 return 0;
1209} 1210}
1210 1211
1211static void __exit gigaset_exit_module(void) 1212static void __exit gigaset_exit_module(void)
1212{ 1213{
1214 gigaset_isdn_unregdrv();
1213} 1215}
1214 1216
1215module_init(gigaset_init_module); 1217module_init(gigaset_init_module);