diff options
author | Tilman Schmidt <tilman@imap.cc> | 2010-03-14 08:58:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-15 19:00:49 -0400 |
commit | bc35b4e347c047fb1c665bb761ddb22482539f7f (patch) | |
tree | 4f5b4b1c882b2f36015e0aada78e9307e812a0f9 /drivers/isdn/gigaset/i4l.c | |
parent | 4d823be98c5b24d94c7f41a384a4bb60d7848ad5 (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/i4l.c')
-rw-r--r-- | drivers/isdn/gigaset/i4l.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c index f0acb9dc9e33..c22e5ace8276 100644 --- a/drivers/isdn/gigaset/i4l.c +++ b/drivers/isdn/gigaset/i4l.c | |||
@@ -592,15 +592,13 @@ void gigaset_isdn_stop(struct cardstate *cs) | |||
592 | } | 592 | } |
593 | 593 | ||
594 | /** | 594 | /** |
595 | * gigaset_isdn_register() - register to LL | 595 | * gigaset_isdn_regdev() - register to LL |
596 | * @cs: device descriptor structure. | 596 | * @cs: device descriptor structure. |
597 | * @isdnid: device name. | 597 | * @isdnid: device name. |
598 | * | 598 | * |
599 | * Called by main module to register the device with the LL. | ||
600 | * | ||
601 | * Return value: 1 for success, 0 for failure | 599 | * Return value: 1 for success, 0 for failure |
602 | */ | 600 | */ |
603 | int gigaset_isdn_register(struct cardstate *cs, const char *isdnid) | 601 | int gigaset_isdn_regdev(struct cardstate *cs, const char *isdnid) |
604 | { | 602 | { |
605 | isdn_if *iif; | 603 | isdn_if *iif; |
606 | 604 | ||
@@ -650,15 +648,29 @@ int gigaset_isdn_register(struct cardstate *cs, const char *isdnid) | |||
650 | } | 648 | } |
651 | 649 | ||
652 | /** | 650 | /** |
653 | * gigaset_isdn_unregister() - unregister from LL | 651 | * gigaset_isdn_unregdev() - unregister device from LL |
654 | * @cs: device descriptor structure. | 652 | * @cs: device descriptor structure. |
655 | * | ||
656 | * Called by main module to unregister the device from the LL. | ||
657 | */ | 653 | */ |
658 | void gigaset_isdn_unregister(struct cardstate *cs) | 654 | void gigaset_isdn_unregdev(struct cardstate *cs) |
659 | { | 655 | { |
660 | gig_dbg(DEBUG_CMD, "sending UNLOAD"); | 656 | gig_dbg(DEBUG_CMD, "sending UNLOAD"); |
661 | gigaset_i4l_cmd(cs, ISDN_STAT_UNLOAD); | 657 | gigaset_i4l_cmd(cs, ISDN_STAT_UNLOAD); |
662 | kfree(cs->iif); | 658 | kfree(cs->iif); |
663 | cs->iif = NULL; | 659 | cs->iif = NULL; |
664 | } | 660 | } |
661 | |||
662 | /** | ||
663 | * gigaset_isdn_regdrv() - register driver to LL | ||
664 | */ | ||
665 | void gigaset_isdn_regdrv(void) | ||
666 | { | ||
667 | /* nothing to do */ | ||
668 | } | ||
669 | |||
670 | /** | ||
671 | * gigaset_isdn_unregdrv() - unregister driver from LL | ||
672 | */ | ||
673 | void gigaset_isdn_unregdrv(void) | ||
674 | { | ||
675 | /* nothing to do */ | ||
676 | } | ||