aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 15:25:35 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 18:03:20 -0500
commitb463581154f3f3eecda27cae60df813fefcd84d3 (patch)
tree5e5b0f7a32b0727b64e52b9b2649897e6c841074 /drivers/isdn
parentf3990715589d378a2d3aa9b8accd78bb4a2378b7 (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/isdn')
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c21
-rw-r--r--drivers/isdn/hisax/avma1_cs.c21
-rw-r--r--drivers/isdn/hisax/elsa_cs.c28
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c28
-rw-r--r--drivers/isdn/hisax/teles_cs.c28
5 files changed, 11 insertions, 115 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 2d898d3afc97..0a8c1da10b4b 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -83,15 +83,7 @@ static dev_info_t dev_info = "avm_cs";
83 device numbers are used to derive the corresponding array index. 83 device numbers are used to derive the corresponding array index.
84*/ 84*/
85 85
86static dev_link_t *dev_list = NULL;
87
88/* 86/*
89 A dev_link_t structure has fields for most things that are needed
90 to keep track of a socket, but there will usually be some device
91 specific information that also needs to be kept track of. The
92 'priv' pointer in a dev_link_t structure can be used to point to
93 a device-specific private data structure, like this.
94
95 A driver needs to provide a dev_node_t structure for each device 87 A driver needs to provide a dev_node_t structure for each device
96 on a card. In some cases, there is only one device per card (for 88 on a card. In some cases, there is only one device per card (for
97 example, ethernet cards, modems). In other cases, there may be 89 example, ethernet cards, modems). In other cases, there may be
@@ -157,8 +149,7 @@ static dev_link_t *avmcs_attach(void)
157 link->priv = local; 149 link->priv = local;
158 150
159 /* Register with Card Services */ 151 /* Register with Card Services */
160 link->next = dev_list; 152 link->next = NULL;
161 dev_list = link;
162 client_reg.dev_info = &dev_info; 153 client_reg.dev_info = &dev_info;
163 client_reg.Version = 0x0210; 154 client_reg.Version = 0x0210;
164 client_reg.event_callback_args.client_data = link; 155 client_reg.event_callback_args.client_data = link;
@@ -188,19 +179,10 @@ static dev_link_t *avmcs_attach(void)
188static void avmcs_detach(struct pcmcia_device *p_dev) 179static void avmcs_detach(struct pcmcia_device *p_dev)
189{ 180{
190 dev_link_t *link = dev_to_instance(p_dev); 181 dev_link_t *link = dev_to_instance(p_dev);
191 dev_link_t **linkp;
192
193 /* Locate device structure */
194 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
195 if (*linkp == link) break;
196 if (*linkp == NULL)
197 return;
198 182
199 if (link->state & DEV_CONFIG) 183 if (link->state & DEV_CONFIG)
200 avmcs_release(link); 184 avmcs_release(link);
201 185
202 /* Unlink device structure, free pieces */
203 *linkp = link->next;
204 kfree(link->priv); 186 kfree(link->priv);
205 kfree(link); 187 kfree(link);
206} /* avmcs_detach */ 188} /* avmcs_detach */
@@ -494,7 +476,6 @@ static int __init avmcs_init(void)
494static void __exit avmcs_exit(void) 476static void __exit avmcs_exit(void)
495{ 477{
496 pcmcia_unregister_driver(&avmcs_driver); 478 pcmcia_unregister_driver(&avmcs_driver);
497 BUG_ON(dev_list != NULL);
498} 479}
499 480
500module_init(avmcs_init); 481module_init(avmcs_init);
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 6b322e88c6c3..b6ea653f881e 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -99,15 +99,7 @@ static dev_info_t dev_info = "avma1_cs";
99 device numbers are used to derive the corresponding array index. 99 device numbers are used to derive the corresponding array index.
100*/ 100*/
101 101
102static dev_link_t *dev_list = NULL;
103
104/* 102/*
105 A dev_link_t structure has fields for most things that are needed
106 to keep track of a socket, but there will usually be some device
107 specific information that also needs to be kept track of. The
108 'priv' pointer in a dev_link_t structure can be used to point to
109 a device-specific private data structure, like this.
110
111 A driver needs to provide a dev_node_t structure for each device 103 A driver needs to provide a dev_node_t structure for each device
112 on a card. In some cases, there is only one device per card (for 104 on a card. In some cases, there is only one device per card (for
113 example, ethernet cards, modems). In other cases, there may be 105 example, ethernet cards, modems). In other cases, there may be
@@ -179,8 +171,7 @@ static dev_link_t *avma1cs_attach(void)
179 link->conf.Present = PRESENT_OPTION; 171 link->conf.Present = PRESENT_OPTION;
180 172
181 /* Register with Card Services */ 173 /* Register with Card Services */
182 link->next = dev_list; 174 link->next = NULL;
183 dev_list = link;
184 client_reg.dev_info = &dev_info; 175 client_reg.dev_info = &dev_info;
185 client_reg.Version = 0x0210; 176 client_reg.Version = 0x0210;
186 client_reg.event_callback_args.client_data = link; 177 client_reg.event_callback_args.client_data = link;
@@ -206,21 +197,12 @@ static dev_link_t *avma1cs_attach(void)
206static void avma1cs_detach(struct pcmcia_device *p_dev) 197static void avma1cs_detach(struct pcmcia_device *p_dev)
207{ 198{
208 dev_link_t *link = dev_to_instance(p_dev); 199 dev_link_t *link = dev_to_instance(p_dev);
209 dev_link_t **linkp;
210 200
211 DEBUG(0, "avma1cs_detach(0x%p)\n", link); 201 DEBUG(0, "avma1cs_detach(0x%p)\n", link);
212 202
213 /* Locate device structure */
214 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
215 if (*linkp == link) break;
216 if (*linkp == NULL)
217 return;
218
219 if (link->state & DEV_CONFIG) 203 if (link->state & DEV_CONFIG)
220 avma1cs_release(link); 204 avma1cs_release(link);
221 205
222 /* Unlink device structure, free pieces */
223 *linkp = link->next;
224 kfree(link->priv); 206 kfree(link->priv);
225 kfree(link); 207 kfree(link);
226} /* avma1cs_detach */ 208} /* avma1cs_detach */
@@ -508,7 +490,6 @@ static int __init init_avma1_cs(void)
508static void __exit exit_avma1_cs(void) 490static void __exit exit_avma1_cs(void)
509{ 491{
510 pcmcia_unregister_driver(&avma1cs_driver); 492 pcmcia_unregister_driver(&avma1cs_driver);
511 BUG_ON(dev_list != NULL);
512} 493}
513 494
514module_init(init_avma1_cs); 495module_init(init_avma1_cs);
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index 48cc677249f1..a0c5bad7bc6b 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -126,18 +126,7 @@ static dev_info_t dev_info = "elsa_cs";
126 device numbers are used to derive the corresponding array index. 126 device numbers are used to derive the corresponding array index.
127*/ 127*/
128 128
129static dev_link_t *dev_list = NULL;
130
131/* 129/*
132 A dev_link_t structure has fields for most things that are needed
133 to keep track of a socket, but there will usually be some device
134 specific information that also needs to be kept track of. The
135 'priv' pointer in a dev_link_t structure can be used to point to
136 a device-specific private data structure, like this.
137
138 To simplify the data structure handling, we actually include the
139 dev_link_t structure in the device's private data structure.
140
141 A driver needs to provide a dev_node_t structure for each device 130 A driver needs to provide a dev_node_t structure for each device
142 on a card. In some cases, there is only one device per card (for 131 on a card. In some cases, there is only one device per card (for
143 example, ethernet cards, modems). In other cases, there may be 132 example, ethernet cards, modems). In other cases, there may be
@@ -208,8 +197,7 @@ static dev_link_t *elsa_cs_attach(void)
208 link->conf.IntType = INT_MEMORY_AND_IO; 197 link->conf.IntType = INT_MEMORY_AND_IO;
209 198
210 /* Register with Card Services */ 199 /* Register with Card Services */
211 link->next = dev_list; 200 link->next = NULL;
212 dev_list = link;
213 client_reg.dev_info = &dev_info; 201 client_reg.dev_info = &dev_info;
214 client_reg.Version = 0x0210; 202 client_reg.Version = 0x0210;
215 client_reg.event_callback_args.client_data = link; 203 client_reg.event_callback_args.client_data = link;
@@ -235,24 +223,15 @@ static dev_link_t *elsa_cs_attach(void)
235static void elsa_cs_detach(struct pcmcia_device *p_dev) 223static void elsa_cs_detach(struct pcmcia_device *p_dev)
236{ 224{
237 dev_link_t *link = dev_to_instance(p_dev); 225 dev_link_t *link = dev_to_instance(p_dev);
238 dev_link_t **linkp;
239 local_info_t *info = link->priv; 226 local_info_t *info = link->priv;
240 227
241 DEBUG(0, "elsa_cs_detach(0x%p)\n", link); 228 DEBUG(0, "elsa_cs_detach(0x%p)\n", link);
242 229
243 /* Locate device structure */
244 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
245 if (*linkp == link) break;
246 if (*linkp == NULL)
247 return;
248
249 if (link->state & DEV_CONFIG) { 230 if (link->state & DEV_CONFIG) {
250 ((local_info_t*)link->priv)->busy = 1; 231 info->busy = 1;
251 elsa_cs_release(link); 232 elsa_cs_release(link);
252 } 233 }
253 234
254 /* Unlink device structure and free it */
255 *linkp = link->next;
256 kfree(info); 235 kfree(info);
257 236
258} /* elsa_cs_detach */ 237} /* elsa_cs_detach */
@@ -526,7 +505,6 @@ static int __init init_elsa_cs(void)
526static void __exit exit_elsa_cs(void) 505static void __exit exit_elsa_cs(void)
527{ 506{
528 pcmcia_unregister_driver(&elsa_cs_driver); 507 pcmcia_unregister_driver(&elsa_cs_driver);
529 BUG_ON(dev_list != NULL);
530} 508}
531 509
532module_init(init_elsa_cs); 510module_init(init_elsa_cs);
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index d2386f6867b7..814b32a9ef3b 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -134,18 +134,7 @@ static dev_info_t dev_info = "sedlbauer_cs";
134 device numbers are used to derive the corresponding array index. 134 device numbers are used to derive the corresponding array index.
135*/ 135*/
136 136
137static dev_link_t *dev_list = NULL;
138
139/* 137/*
140 A dev_link_t structure has fields for most things that are needed
141 to keep track of a socket, but there will usually be some device
142 specific information that also needs to be kept track of. The
143 'priv' pointer in a dev_link_t structure can be used to point to
144 a device-specific private data structure, like this.
145
146 To simplify the data structure handling, we actually include the
147 dev_link_t structure in the device's private data structure.
148
149 A driver needs to provide a dev_node_t structure for each device 138 A driver needs to provide a dev_node_t structure for each device
150 on a card. In some cases, there is only one device per card (for 139 on a card. In some cases, there is only one device per card (for
151 example, ethernet cards, modems). In other cases, there may be 140 example, ethernet cards, modems). In other cases, there may be
@@ -222,8 +211,7 @@ static dev_link_t *sedlbauer_attach(void)
222 link->conf.IntType = INT_MEMORY_AND_IO; 211 link->conf.IntType = INT_MEMORY_AND_IO;
223 212
224 /* Register with Card Services */ 213 /* Register with Card Services */
225 link->next = dev_list; 214 link->next = NULL;
226 dev_list = link;
227 client_reg.dev_info = &dev_info; 215 client_reg.dev_info = &dev_info;
228 client_reg.Version = 0x0210; 216 client_reg.Version = 0x0210;
229 client_reg.event_callback_args.client_data = link; 217 client_reg.event_callback_args.client_data = link;
@@ -249,23 +237,14 @@ static dev_link_t *sedlbauer_attach(void)
249static void sedlbauer_detach(struct pcmcia_device *p_dev) 237static void sedlbauer_detach(struct pcmcia_device *p_dev)
250{ 238{
251 dev_link_t *link = dev_to_instance(p_dev); 239 dev_link_t *link = dev_to_instance(p_dev);
252 dev_link_t **linkp;
253 240
254 DEBUG(0, "sedlbauer_detach(0x%p)\n", link); 241 DEBUG(0, "sedlbauer_detach(0x%p)\n", link);
255
256 /* Locate device structure */
257 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
258 if (*linkp == link) break;
259 if (*linkp == NULL)
260 return;
261 242
262 if (link->state & DEV_CONFIG) { 243 if (link->state & DEV_CONFIG) {
263 ((local_info_t *)link->priv)->stop = 1; 244 ((local_info_t *)link->priv)->stop = 1;
264 sedlbauer_release(link); 245 sedlbauer_release(link);
265 } 246 }
266 247
267 /* Unlink device structure, and free it */
268 *linkp = link->next;
269 /* This points to the parent local_info_t struct */ 248 /* This points to the parent local_info_t struct */
270 kfree(link->priv); 249 kfree(link->priv);
271} /* sedlbauer_detach */ 250} /* sedlbauer_detach */
@@ -623,7 +602,6 @@ static int __init init_sedlbauer_cs(void)
623static void __exit exit_sedlbauer_cs(void) 602static void __exit exit_sedlbauer_cs(void)
624{ 603{
625 pcmcia_unregister_driver(&sedlbauer_driver); 604 pcmcia_unregister_driver(&sedlbauer_driver);
626 BUG_ON(dev_list != NULL);
627} 605}
628 606
629module_init(init_sedlbauer_cs); 607module_init(init_sedlbauer_cs);
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index cd0f86f0975b..f956fceb9db2 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -107,18 +107,7 @@ static dev_info_t dev_info = "teles_cs";
107 device numbers are used to derive the corresponding array index. 107 device numbers are used to derive the corresponding array index.
108*/ 108*/
109 109
110static dev_link_t *dev_list = NULL;
111
112/* 110/*
113 A dev_link_t structure has fields for most things that are needed
114 to keep track of a socket, but there will usually be some device
115 specific information that also needs to be kept track of. The
116 'priv' pointer in a dev_link_t structure can be used to point to
117 a device-specific private data structure, like this.
118
119 To simplify the data structure handling, we actually include the
120 dev_link_t structure in the device's private data structure.
121
122 A driver needs to provide a dev_node_t structure for each device 111 A driver needs to provide a dev_node_t structure for each device
123 on a card. In some cases, there is only one device per card (for 112 on a card. In some cases, there is only one device per card (for
124 example, ethernet cards, modems). In other cases, there may be 113 example, ethernet cards, modems). In other cases, there may be
@@ -189,8 +178,7 @@ static dev_link_t *teles_attach(void)
189 link->conf.IntType = INT_MEMORY_AND_IO; 178 link->conf.IntType = INT_MEMORY_AND_IO;
190 179
191 /* Register with Card Services */ 180 /* Register with Card Services */
192 link->next = dev_list; 181 link->next = NULL;
193 dev_list = link;
194 client_reg.dev_info = &dev_info; 182 client_reg.dev_info = &dev_info;
195 client_reg.Version = 0x0210; 183 client_reg.Version = 0x0210;
196 client_reg.event_callback_args.client_data = link; 184 client_reg.event_callback_args.client_data = link;
@@ -216,24 +204,15 @@ static dev_link_t *teles_attach(void)
216static void teles_detach(struct pcmcia_device *p_dev) 204static void teles_detach(struct pcmcia_device *p_dev)
217{ 205{
218 dev_link_t *link = dev_to_instance(p_dev); 206 dev_link_t *link = dev_to_instance(p_dev);
219 dev_link_t **linkp;
220 local_info_t *info = link->priv; 207 local_info_t *info = link->priv;
221 208
222 DEBUG(0, "teles_detach(0x%p)\n", link); 209 DEBUG(0, "teles_detach(0x%p)\n", link);
223 210
224 /* Locate device structure */
225 for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
226 if (*linkp == link) break;
227 if (*linkp == NULL)
228 return;
229
230 if (link->state & DEV_CONFIG) { 211 if (link->state & DEV_CONFIG) {
231 info->busy = 1; 212 info->busy = 1;
232 teles_cs_release(link); 213 teles_cs_release(link);
233 } 214 }
234 215
235 /* Unlink device structure and free it */
236 *linkp = link->next;
237 kfree(info); 216 kfree(info);
238 217
239} /* teles_detach */ 218} /* teles_detach */
@@ -506,7 +485,6 @@ static int __init init_teles_cs(void)
506static void __exit exit_teles_cs(void) 485static void __exit exit_teles_cs(void)
507{ 486{
508 pcmcia_unregister_driver(&teles_cs_driver); 487 pcmcia_unregister_driver(&teles_cs_driver);
509 BUG_ON(dev_list != NULL);
510} 488}
511 489
512module_init(init_teles_cs); 490module_init(init_teles_cs);