diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-11-14 15:25:35 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-05 18:03:20 -0500 |
commit | b463581154f3f3eecda27cae60df813fefcd84d3 (patch) | |
tree | 5e5b0f7a32b0727b64e52b9b2649897e6c841074 /drivers/bluetooth | |
parent | f3990715589d378a2d3aa9b8accd78bb4a2378b7 (diff) |
[PATCH] pcmcia: remove dev_list from drivers
The linked list of devices managed by each PCMCIA driver is, in very most
cases, unused. Therefore, remove it from many drivers.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/bluecard_cs.c | 18 | ||||
-rw-r--r-- | drivers/bluetooth/bt3c_cs.c | 18 | ||||
-rw-r--r-- | drivers/bluetooth/btuart_cs.c | 18 | ||||
-rw-r--r-- | drivers/bluetooth/dtl1_cs.c | 18 |
4 files changed, 4 insertions, 68 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index f5088cb3812b..bd80535646fa 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c | |||
@@ -94,8 +94,6 @@ static dev_info_t dev_info = "bluecard_cs"; | |||
94 | static dev_link_t *bluecard_attach(void); | 94 | static dev_link_t *bluecard_attach(void); |
95 | static void bluecard_detach(struct pcmcia_device *p_dev); | 95 | static void bluecard_detach(struct pcmcia_device *p_dev); |
96 | 96 | ||
97 | static dev_link_t *dev_list = NULL; | ||
98 | |||
99 | 97 | ||
100 | /* Default baud rate: 57600, 115200, 230400 or 460800 */ | 98 | /* Default baud rate: 57600, 115200, 230400 or 460800 */ |
101 | #define DEFAULT_BAUD_RATE 230400 | 99 | #define DEFAULT_BAUD_RATE 230400 |
@@ -890,8 +888,7 @@ static dev_link_t *bluecard_attach(void) | |||
890 | link->conf.IntType = INT_MEMORY_AND_IO; | 888 | link->conf.IntType = INT_MEMORY_AND_IO; |
891 | 889 | ||
892 | /* Register with Card Services */ | 890 | /* Register with Card Services */ |
893 | link->next = dev_list; | 891 | link->next = NULL; |
894 | dev_list = link; | ||
895 | client_reg.dev_info = &dev_info; | 892 | client_reg.dev_info = &dev_info; |
896 | client_reg.Version = 0x0210; | 893 | client_reg.Version = 0x0210; |
897 | client_reg.event_callback_args.client_data = link; | 894 | client_reg.event_callback_args.client_data = link; |
@@ -911,22 +908,10 @@ static void bluecard_detach(struct pcmcia_device *p_dev) | |||
911 | { | 908 | { |
912 | dev_link_t *link = dev_to_instance(p_dev); | 909 | dev_link_t *link = dev_to_instance(p_dev); |
913 | bluecard_info_t *info = link->priv; | 910 | bluecard_info_t *info = link->priv; |
914 | dev_link_t **linkp; | ||
915 | |||
916 | /* Locate device structure */ | ||
917 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
918 | if (*linkp == link) | ||
919 | break; | ||
920 | |||
921 | if (*linkp == NULL) | ||
922 | return; | ||
923 | 911 | ||
924 | if (link->state & DEV_CONFIG) | 912 | if (link->state & DEV_CONFIG) |
925 | bluecard_release(link); | 913 | bluecard_release(link); |
926 | 914 | ||
927 | /* Unlink device structure, free bits */ | ||
928 | *linkp = link->next; | ||
929 | |||
930 | kfree(info); | 915 | kfree(info); |
931 | } | 916 | } |
932 | 917 | ||
@@ -1105,7 +1090,6 @@ static int __init init_bluecard_cs(void) | |||
1105 | static void __exit exit_bluecard_cs(void) | 1090 | static void __exit exit_bluecard_cs(void) |
1106 | { | 1091 | { |
1107 | pcmcia_unregister_driver(&bluecard_driver); | 1092 | pcmcia_unregister_driver(&bluecard_driver); |
1108 | BUG_ON(dev_list != NULL); | ||
1109 | } | 1093 | } |
1110 | 1094 | ||
1111 | module_init(init_bluecard_cs); | 1095 | module_init(init_bluecard_cs); |
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index 02ce38e33d32..50aa52b3cd20 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c | |||
@@ -97,8 +97,6 @@ static dev_info_t dev_info = "bt3c_cs"; | |||
97 | static dev_link_t *bt3c_attach(void); | 97 | static dev_link_t *bt3c_attach(void); |
98 | static void bt3c_detach(struct pcmcia_device *p_dev); | 98 | static void bt3c_detach(struct pcmcia_device *p_dev); |
99 | 99 | ||
100 | static dev_link_t *dev_list = NULL; | ||
101 | |||
102 | 100 | ||
103 | /* Transmit states */ | 101 | /* Transmit states */ |
104 | #define XMIT_SENDING 1 | 102 | #define XMIT_SENDING 1 |
@@ -691,8 +689,7 @@ static dev_link_t *bt3c_attach(void) | |||
691 | link->conf.IntType = INT_MEMORY_AND_IO; | 689 | link->conf.IntType = INT_MEMORY_AND_IO; |
692 | 690 | ||
693 | /* Register with Card Services */ | 691 | /* Register with Card Services */ |
694 | link->next = dev_list; | 692 | link->next = NULL; |
695 | dev_list = link; | ||
696 | client_reg.dev_info = &dev_info; | 693 | client_reg.dev_info = &dev_info; |
697 | client_reg.Version = 0x0210; | 694 | client_reg.Version = 0x0210; |
698 | client_reg.event_callback_args.client_data = link; | 695 | client_reg.event_callback_args.client_data = link; |
@@ -712,22 +709,10 @@ static void bt3c_detach(struct pcmcia_device *p_dev) | |||
712 | { | 709 | { |
713 | dev_link_t *link = dev_to_instance(p_dev); | 710 | dev_link_t *link = dev_to_instance(p_dev); |
714 | bt3c_info_t *info = link->priv; | 711 | bt3c_info_t *info = link->priv; |
715 | dev_link_t **linkp; | ||
716 | |||
717 | /* Locate device structure */ | ||
718 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
719 | if (*linkp == link) | ||
720 | break; | ||
721 | |||
722 | if (*linkp == NULL) | ||
723 | return; | ||
724 | 712 | ||
725 | if (link->state & DEV_CONFIG) | 713 | if (link->state & DEV_CONFIG) |
726 | bt3c_release(link); | 714 | bt3c_release(link); |
727 | 715 | ||
728 | /* Unlink device structure, free bits */ | ||
729 | *linkp = link->next; | ||
730 | |||
731 | kfree(info); | 716 | kfree(info); |
732 | } | 717 | } |
733 | 718 | ||
@@ -949,7 +934,6 @@ static int __init init_bt3c_cs(void) | |||
949 | static void __exit exit_bt3c_cs(void) | 934 | static void __exit exit_bt3c_cs(void) |
950 | { | 935 | { |
951 | pcmcia_unregister_driver(&bt3c_driver); | 936 | pcmcia_unregister_driver(&bt3c_driver); |
952 | BUG_ON(dev_list != NULL); | ||
953 | } | 937 | } |
954 | 938 | ||
955 | module_init(init_bt3c_cs); | 939 | module_init(init_bt3c_cs); |
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 63221d383fda..7b04f89f7a71 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
@@ -93,8 +93,6 @@ static dev_info_t dev_info = "btuart_cs"; | |||
93 | static dev_link_t *btuart_attach(void); | 93 | static dev_link_t *btuart_attach(void); |
94 | static void btuart_detach(struct pcmcia_device *p_dev); | 94 | static void btuart_detach(struct pcmcia_device *p_dev); |
95 | 95 | ||
96 | static dev_link_t *dev_list = NULL; | ||
97 | |||
98 | 96 | ||
99 | /* Maximum baud rate */ | 97 | /* Maximum baud rate */ |
100 | #define SPEED_MAX 115200 | 98 | #define SPEED_MAX 115200 |
@@ -610,8 +608,7 @@ static dev_link_t *btuart_attach(void) | |||
610 | link->conf.IntType = INT_MEMORY_AND_IO; | 608 | link->conf.IntType = INT_MEMORY_AND_IO; |
611 | 609 | ||
612 | /* Register with Card Services */ | 610 | /* Register with Card Services */ |
613 | link->next = dev_list; | 611 | link->next = NULL; |
614 | dev_list = link; | ||
615 | client_reg.dev_info = &dev_info; | 612 | client_reg.dev_info = &dev_info; |
616 | client_reg.Version = 0x0210; | 613 | client_reg.Version = 0x0210; |
617 | client_reg.event_callback_args.client_data = link; | 614 | client_reg.event_callback_args.client_data = link; |
@@ -631,22 +628,10 @@ static void btuart_detach(struct pcmcia_device *p_dev) | |||
631 | { | 628 | { |
632 | dev_link_t *link = dev_to_instance(p_dev); | 629 | dev_link_t *link = dev_to_instance(p_dev); |
633 | btuart_info_t *info = link->priv; | 630 | btuart_info_t *info = link->priv; |
634 | dev_link_t **linkp; | ||
635 | |||
636 | /* Locate device structure */ | ||
637 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
638 | if (*linkp == link) | ||
639 | break; | ||
640 | |||
641 | if (*linkp == NULL) | ||
642 | return; | ||
643 | 631 | ||
644 | if (link->state & DEV_CONFIG) | 632 | if (link->state & DEV_CONFIG) |
645 | btuart_release(link); | 633 | btuart_release(link); |
646 | 634 | ||
647 | /* Unlink device structure, free bits */ | ||
648 | *linkp = link->next; | ||
649 | |||
650 | kfree(info); | 635 | kfree(info); |
651 | } | 636 | } |
652 | 637 | ||
@@ -870,7 +855,6 @@ static int __init init_btuart_cs(void) | |||
870 | static void __exit exit_btuart_cs(void) | 855 | static void __exit exit_btuart_cs(void) |
871 | { | 856 | { |
872 | pcmcia_unregister_driver(&btuart_driver); | 857 | pcmcia_unregister_driver(&btuart_driver); |
873 | BUG_ON(dev_list != NULL); | ||
874 | } | 858 | } |
875 | 859 | ||
876 | module_init(init_btuart_cs); | 860 | module_init(init_btuart_cs); |
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index 2874d8722be9..c39d4576cfff 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c | |||
@@ -96,8 +96,6 @@ static dev_info_t dev_info = "dtl1_cs"; | |||
96 | static dev_link_t *dtl1_attach(void); | 96 | static dev_link_t *dtl1_attach(void); |
97 | static void dtl1_detach(struct pcmcia_device *p_dev); | 97 | static void dtl1_detach(struct pcmcia_device *p_dev); |
98 | 98 | ||
99 | static dev_link_t *dev_list = NULL; | ||
100 | |||
101 | 99 | ||
102 | /* Transmit states */ | 100 | /* Transmit states */ |
103 | #define XMIT_SENDING 1 | 101 | #define XMIT_SENDING 1 |
@@ -589,8 +587,7 @@ static dev_link_t *dtl1_attach(void) | |||
589 | link->conf.IntType = INT_MEMORY_AND_IO; | 587 | link->conf.IntType = INT_MEMORY_AND_IO; |
590 | 588 | ||
591 | /* Register with Card Services */ | 589 | /* Register with Card Services */ |
592 | link->next = dev_list; | 590 | link->next = NULL; |
593 | dev_list = link; | ||
594 | client_reg.dev_info = &dev_info; | 591 | client_reg.dev_info = &dev_info; |
595 | client_reg.Version = 0x0210; | 592 | client_reg.Version = 0x0210; |
596 | client_reg.event_callback_args.client_data = link; | 593 | client_reg.event_callback_args.client_data = link; |
@@ -610,22 +607,10 @@ static void dtl1_detach(struct pcmcia_device *p_dev) | |||
610 | { | 607 | { |
611 | dev_link_t *link = dev_to_instance(p_dev); | 608 | dev_link_t *link = dev_to_instance(p_dev); |
612 | dtl1_info_t *info = link->priv; | 609 | dtl1_info_t *info = link->priv; |
613 | dev_link_t **linkp; | ||
614 | |||
615 | /* Locate device structure */ | ||
616 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
617 | if (*linkp == link) | ||
618 | break; | ||
619 | |||
620 | if (*linkp == NULL) | ||
621 | return; | ||
622 | 610 | ||
623 | if (link->state & DEV_CONFIG) | 611 | if (link->state & DEV_CONFIG) |
624 | dtl1_release(link); | 612 | dtl1_release(link); |
625 | 613 | ||
626 | /* Unlink device structure, free bits */ | ||
627 | *linkp = link->next; | ||
628 | |||
629 | kfree(info); | 614 | kfree(info); |
630 | } | 615 | } |
631 | 616 | ||
@@ -822,7 +807,6 @@ static int __init init_dtl1_cs(void) | |||
822 | static void __exit exit_dtl1_cs(void) | 807 | static void __exit exit_dtl1_cs(void) |
823 | { | 808 | { |
824 | pcmcia_unregister_driver(&dtl1_driver); | 809 | pcmcia_unregister_driver(&dtl1_driver); |
825 | BUG_ON(dev_list != NULL); | ||
826 | } | 810 | } |
827 | 811 | ||
828 | module_init(init_dtl1_cs); | 812 | module_init(init_dtl1_cs); |