Commit b4635811 authored by Dominik Brodowski's avatar Dominik Brodowski

[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: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent f3990715
...@@ -94,8 +94,6 @@ static dev_info_t dev_info = "bluecard_cs"; ...@@ -94,8 +94,6 @@ static dev_info_t dev_info = "bluecard_cs";
static dev_link_t *bluecard_attach(void); static dev_link_t *bluecard_attach(void);
static void bluecard_detach(struct pcmcia_device *p_dev); static void bluecard_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list = NULL;
/* Default baud rate: 57600, 115200, 230400 or 460800 */ /* Default baud rate: 57600, 115200, 230400 or 460800 */
#define DEFAULT_BAUD_RATE 230400 #define DEFAULT_BAUD_RATE 230400
...@@ -890,8 +888,7 @@ static dev_link_t *bluecard_attach(void) ...@@ -890,8 +888,7 @@ static dev_link_t *bluecard_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -911,22 +908,10 @@ static void bluecard_detach(struct pcmcia_device *p_dev) ...@@ -911,22 +908,10 @@ static void bluecard_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
bluecard_info_t *info = link->priv; bluecard_info_t *info = link->priv;
dev_link_t **linkp;
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
bluecard_release(link); bluecard_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
kfree(info); kfree(info);
} }
...@@ -1105,7 +1090,6 @@ static int __init init_bluecard_cs(void) ...@@ -1105,7 +1090,6 @@ static int __init init_bluecard_cs(void)
static void __exit exit_bluecard_cs(void) static void __exit exit_bluecard_cs(void)
{ {
pcmcia_unregister_driver(&bluecard_driver); pcmcia_unregister_driver(&bluecard_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_bluecard_cs); module_init(init_bluecard_cs);
......
...@@ -97,8 +97,6 @@ static dev_info_t dev_info = "bt3c_cs"; ...@@ -97,8 +97,6 @@ static dev_info_t dev_info = "bt3c_cs";
static dev_link_t *bt3c_attach(void); static dev_link_t *bt3c_attach(void);
static void bt3c_detach(struct pcmcia_device *p_dev); static void bt3c_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list = NULL;
/* Transmit states */ /* Transmit states */
#define XMIT_SENDING 1 #define XMIT_SENDING 1
...@@ -691,8 +689,7 @@ static dev_link_t *bt3c_attach(void) ...@@ -691,8 +689,7 @@ static dev_link_t *bt3c_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -712,22 +709,10 @@ static void bt3c_detach(struct pcmcia_device *p_dev) ...@@ -712,22 +709,10 @@ static void bt3c_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
bt3c_info_t *info = link->priv; bt3c_info_t *info = link->priv;
dev_link_t **linkp;
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
bt3c_release(link); bt3c_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
kfree(info); kfree(info);
} }
...@@ -949,7 +934,6 @@ static int __init init_bt3c_cs(void) ...@@ -949,7 +934,6 @@ static int __init init_bt3c_cs(void)
static void __exit exit_bt3c_cs(void) static void __exit exit_bt3c_cs(void)
{ {
pcmcia_unregister_driver(&bt3c_driver); pcmcia_unregister_driver(&bt3c_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_bt3c_cs); module_init(init_bt3c_cs);
......
...@@ -93,8 +93,6 @@ static dev_info_t dev_info = "btuart_cs"; ...@@ -93,8 +93,6 @@ static dev_info_t dev_info = "btuart_cs";
static dev_link_t *btuart_attach(void); static dev_link_t *btuart_attach(void);
static void btuart_detach(struct pcmcia_device *p_dev); static void btuart_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list = NULL;
/* Maximum baud rate */ /* Maximum baud rate */
#define SPEED_MAX 115200 #define SPEED_MAX 115200
...@@ -610,8 +608,7 @@ static dev_link_t *btuart_attach(void) ...@@ -610,8 +608,7 @@ static dev_link_t *btuart_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -631,22 +628,10 @@ static void btuart_detach(struct pcmcia_device *p_dev) ...@@ -631,22 +628,10 @@ static void btuart_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
btuart_info_t *info = link->priv; btuart_info_t *info = link->priv;
dev_link_t **linkp;
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
btuart_release(link); btuart_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
kfree(info); kfree(info);
} }
...@@ -870,7 +855,6 @@ static int __init init_btuart_cs(void) ...@@ -870,7 +855,6 @@ static int __init init_btuart_cs(void)
static void __exit exit_btuart_cs(void) static void __exit exit_btuart_cs(void)
{ {
pcmcia_unregister_driver(&btuart_driver); pcmcia_unregister_driver(&btuart_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_btuart_cs); module_init(init_btuart_cs);
......
...@@ -96,8 +96,6 @@ static dev_info_t dev_info = "dtl1_cs"; ...@@ -96,8 +96,6 @@ static dev_info_t dev_info = "dtl1_cs";
static dev_link_t *dtl1_attach(void); static dev_link_t *dtl1_attach(void);
static void dtl1_detach(struct pcmcia_device *p_dev); static void dtl1_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list = NULL;
/* Transmit states */ /* Transmit states */
#define XMIT_SENDING 1 #define XMIT_SENDING 1
...@@ -589,8 +587,7 @@ static dev_link_t *dtl1_attach(void) ...@@ -589,8 +587,7 @@ static dev_link_t *dtl1_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -610,22 +607,10 @@ static void dtl1_detach(struct pcmcia_device *p_dev) ...@@ -610,22 +607,10 @@ static void dtl1_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dtl1_info_t *info = link->priv; dtl1_info_t *info = link->priv;
dev_link_t **linkp;
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
dtl1_release(link); dtl1_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
kfree(info); kfree(info);
} }
...@@ -822,7 +807,6 @@ static int __init init_dtl1_cs(void) ...@@ -822,7 +807,6 @@ static int __init init_dtl1_cs(void)
static void __exit exit_dtl1_cs(void) static void __exit exit_dtl1_cs(void)
{ {
pcmcia_unregister_driver(&dtl1_driver); pcmcia_unregister_driver(&dtl1_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_dtl1_cs); module_init(init_dtl1_cs);
......
...@@ -492,7 +492,6 @@ static dev_link_t *mgslpc_attach(void); ...@@ -492,7 +492,6 @@ static dev_link_t *mgslpc_attach(void);
static void mgslpc_detach(struct pcmcia_device *p_dev); static void mgslpc_detach(struct pcmcia_device *p_dev);
static dev_info_t dev_info = "synclink_cs"; static dev_info_t dev_info = "synclink_cs";
static dev_link_t *dev_list = NULL;
/* /*
* 1st function defined in .text section. Calling this function in * 1st function defined in .text section. Calling this function in
...@@ -588,8 +587,7 @@ static dev_link_t *mgslpc_attach(void) ...@@ -588,8 +587,7 @@ static dev_link_t *mgslpc_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
...@@ -741,24 +739,15 @@ static void mgslpc_release(u_long arg) ...@@ -741,24 +739,15 @@ static void mgslpc_release(u_long arg)
static void mgslpc_detach(struct pcmcia_device *p_dev) static void mgslpc_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
if (debug_level >= DEBUG_LEVEL_INFO) if (debug_level >= DEBUG_LEVEL_INFO)
printk("mgslpc_detach(0x%p)\n", link); printk("mgslpc_detach(0x%p)\n", link);
/* find device */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
((MGSLPC_INFO *)link->priv)->stop = 1; ((MGSLPC_INFO *)link->priv)->stop = 1;
mgslpc_release((u_long)link); mgslpc_release((u_long)link);
} }
/* Unlink device structure, and free it */
*linkp = link->next;
mgslpc_remove_device((MGSLPC_INFO *)link->priv); mgslpc_remove_device((MGSLPC_INFO *)link->priv);
} }
...@@ -3131,7 +3120,6 @@ static void synclink_cs_cleanup(void) ...@@ -3131,7 +3120,6 @@ static void synclink_cs_cleanup(void)
} }
pcmcia_unregister_driver(&mgslpc_driver); pcmcia_unregister_driver(&mgslpc_driver);
BUG_ON(dev_list != NULL);
} }
static int __init synclink_cs_init(void) static int __init synclink_cs_init(void)
......
...@@ -96,7 +96,8 @@ static dev_info_t dev_info = "ide-cs"; ...@@ -96,7 +96,8 @@ static dev_info_t dev_info = "ide-cs";
static dev_link_t *ide_attach(void); static dev_link_t *ide_attach(void);
static void ide_detach(struct pcmcia_device *p_dev); static void ide_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list = NULL;
/*====================================================================== /*======================================================================
...@@ -130,8 +131,7 @@ static dev_link_t *ide_attach(void) ...@@ -130,8 +131,7 @@ static dev_link_t *ide_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -157,23 +157,13 @@ static dev_link_t *ide_attach(void) ...@@ -157,23 +157,13 @@ static dev_link_t *ide_attach(void)
static void ide_detach(struct pcmcia_device *p_dev) static void ide_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DEBUG(0, "ide_detach(0x%p)\n", link); DEBUG(0, "ide_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
ide_release(link); ide_release(link);
/* Unlink, free device structure */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
} /* ide_detach */ } /* ide_detach */
static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle) static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
...@@ -507,7 +497,6 @@ static int __init init_ide_cs(void) ...@@ -507,7 +497,6 @@ static int __init init_ide_cs(void)
static void __exit exit_ide_cs(void) static void __exit exit_ide_cs(void)
{ {
pcmcia_unregister_driver(&ide_cs_driver); pcmcia_unregister_driver(&ide_cs_driver);
BUG_ON(dev_list != NULL);
} }
late_initcall(init_ide_cs); late_initcall(init_ide_cs);
......
...@@ -83,15 +83,7 @@ static dev_info_t dev_info = "avm_cs"; ...@@ -83,15 +83,7 @@ static dev_info_t dev_info = "avm_cs";
device numbers are used to derive the corresponding array index. device numbers are used to derive the corresponding array index.
*/ */
static dev_link_t *dev_list = NULL;
/* /*
A dev_link_t structure has fields for most things that are needed
to keep track of a socket, but there will usually be some device
specific information that also needs to be kept track of. The
'priv' pointer in a dev_link_t structure can be used to point to
a device-specific private data structure, like this.
A driver needs to provide a dev_node_t structure for each device A driver needs to provide a dev_node_t structure for each device
on a card. In some cases, there is only one device per card (for on a card. In some cases, there is only one device per card (for
example, ethernet cards, modems). In other cases, there may be example, ethernet cards, modems). In other cases, there may be
...@@ -157,8 +149,7 @@ static dev_link_t *avmcs_attach(void) ...@@ -157,8 +149,7 @@ static dev_link_t *avmcs_attach(void)
link->priv = local; link->priv = local;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -188,19 +179,10 @@ static dev_link_t *avmcs_attach(void) ...@@ -188,19 +179,10 @@ static dev_link_t *avmcs_attach(void)
static void avmcs_detach(struct pcmcia_device *p_dev) static void avmcs_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
avmcs_release(link); avmcs_release(link);
/* Unlink device structure, free pieces */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
kfree(link); kfree(link);
} /* avmcs_detach */ } /* avmcs_detach */
...@@ -494,7 +476,6 @@ static int __init avmcs_init(void) ...@@ -494,7 +476,6 @@ static int __init avmcs_init(void)
static void __exit avmcs_exit(void) static void __exit avmcs_exit(void)
{ {
pcmcia_unregister_driver(&avmcs_driver); pcmcia_unregister_driver(&avmcs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(avmcs_init); module_init(avmcs_init);
......
...@@ -99,15 +99,7 @@ static dev_info_t dev_info = "avma1_cs"; ...@@ -99,15 +99,7 @@ static dev_info_t dev_info = "avma1_cs";
device numbers are used to derive the corresponding array index. device numbers are used to derive the corresponding array index.
*/ */
static dev_link_t *dev_list = NULL;
/* /*
A dev_link_t structure has fields for most things that are needed
to keep track of a socket, but there will usually be some device
specific information that also needs to be kept track of. The
'priv' pointer in a dev_link_t structure can be used to point to
a device-specific private data structure, like this.
A driver needs to provide a dev_node_t structure for each device A driver needs to provide a dev_node_t structure for each device
on a card. In some cases, there is only one device per card (for on a card. In some cases, there is only one device per card (for
example, ethernet cards, modems). In other cases, there may be example, ethernet cards, modems). In other cases, there may be
...@@ -179,8 +171,7 @@ static dev_link_t *avma1cs_attach(void) ...@@ -179,8 +171,7 @@ static dev_link_t *avma1cs_attach(void)
link->conf.Present = PRESENT_OPTION; link->conf.Present = PRESENT_OPTION;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -206,21 +197,12 @@ static dev_link_t *avma1cs_attach(void) ...@@ -206,21 +197,12 @@ static dev_link_t *avma1cs_attach(void)
static void avma1cs_detach(struct pcmcia_device *p_dev) static void avma1cs_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DEBUG(0, "avma1cs_detach(0x%p)\n", link); DEBUG(0, "avma1cs_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
avma1cs_release(link); avma1cs_release(link);
/* Unlink device structure, free pieces */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
kfree(link); kfree(link);
} /* avma1cs_detach */ } /* avma1cs_detach */
...@@ -508,7 +490,6 @@ static int __init init_avma1_cs(void) ...@@ -508,7 +490,6 @@ static int __init init_avma1_cs(void)
static void __exit exit_avma1_cs(void) static void __exit exit_avma1_cs(void)
{ {
pcmcia_unregister_driver(&avma1cs_driver); pcmcia_unregister_driver(&avma1cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_avma1_cs); module_init(init_avma1_cs);
......
...@@ -126,18 +126,7 @@ static dev_info_t dev_info = "elsa_cs"; ...@@ -126,18 +126,7 @@ static dev_info_t dev_info = "elsa_cs";
device numbers are used to derive the corresponding array index. device numbers are used to derive the corresponding array index.
*/ */
static dev_link_t *dev_list = NULL;
/* /*
A dev_link_t structure has fields for most things that are needed
to keep track of a socket, but there will usually be some device
specific information that also needs to be kept track of. The
'priv' pointer in a dev_link_t structure can be used to point to
a device-specific private data structure, like this.
To simplify the data structure handling, we actually include the
dev_link_t structure in the device's private data structure.
A driver needs to provide a dev_node_t structure for each device A driver needs to provide a dev_node_t structure for each device
on a card. In some cases, there is only one device per card (for on a card. In some cases, there is only one device per card (for
example, ethernet cards, modems). In other cases, there may be example, ethernet cards, modems). In other cases, there may be
...@@ -208,8 +197,7 @@ static dev_link_t *elsa_cs_attach(void) ...@@ -208,8 +197,7 @@ static dev_link_t *elsa_cs_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -235,24 +223,15 @@ static dev_link_t *elsa_cs_attach(void) ...@@ -235,24 +223,15 @@ static dev_link_t *elsa_cs_attach(void)
static void elsa_cs_detach(struct pcmcia_device *p_dev) static void elsa_cs_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
local_info_t *info = link->priv; local_info_t *info = link->priv;
DEBUG(0, "elsa_cs_detach(0x%p)\n", link); DEBUG(0, "elsa_cs_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
((local_info_t*)link->priv)->busy = 1; info->busy = 1;
elsa_cs_release(link); elsa_cs_release(link);
} }
/* Unlink device structure and free it */
*linkp = link->next;
kfree(info); kfree(info);
} /* elsa_cs_detach */ } /* elsa_cs_detach */
...@@ -526,7 +505,6 @@ static int __init init_elsa_cs(void) ...@@ -526,7 +505,6 @@ static int __init init_elsa_cs(void)
static void __exit exit_elsa_cs(void) static void __exit exit_elsa_cs(void)
{ {
pcmcia_unregister_driver(&elsa_cs_driver); pcmcia_unregister_driver(&elsa_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_elsa_cs); module_init(init_elsa_cs);
......
...@@ -134,18 +134,7 @@ static dev_info_t dev_info = "sedlbauer_cs"; ...@@ -134,18 +134,7 @@ static dev_info_t dev_info = "sedlbauer_cs";
device numbers are used to derive the corresponding array index. device numbers are used to derive the corresponding array index.
*/ */
static dev_link_t *dev_list = NULL;
/* /*
A dev_link_t structure has fields for most things that are needed
to keep track of a socket, but there will usually be some device
specific information that also needs to be kept track of. The
'priv' pointer in a dev_link_t structure can be used to point to
a device-specific private data structure, like this.
To simplify the data structure handling, we actually include the
dev_link_t structure in the device's private data structure.
A driver needs to provide a dev_node_t structure for each device A driver needs to provide a dev_node_t structure for each device
on a card. In some cases, there is only one device per card (for on a card. In some cases, there is only one device per card (for
example, ethernet cards, modems). In other cases, there may be example, ethernet cards, modems). In other cases, there may be
...@@ -222,8 +211,7 @@ static dev_link_t *sedlbauer_attach(void) ...@@ -222,8 +211,7 @@ static dev_link_t *sedlbauer_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -249,23 +237,14 @@ static dev_link_t *sedlbauer_attach(void) ...@@ -249,23 +237,14 @@ static dev_link_t *sedlbauer_attach(void)
static void sedlbauer_detach(struct pcmcia_device *p_dev) static void sedlbauer_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DEBUG(0, "sedlbauer_detach(0x%p)\n", link); DEBUG(0, "sedlbauer_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
((local_info_t *)link->priv)->stop = 1; ((local_info_t *)link->priv)->stop = 1;
sedlbauer_release(link); sedlbauer_release(link);
} }
/* Unlink device structure, and free it */
*linkp = link->next;
/* This points to the parent local_info_t struct */ /* This points to the parent local_info_t struct */
kfree(link->priv); kfree(link->priv);
} /* sedlbauer_detach */ } /* sedlbauer_detach */
...@@ -623,7 +602,6 @@ static int __init init_sedlbauer_cs(void) ...@@ -623,7 +602,6 @@ static int __init init_sedlbauer_cs(void)
static void __exit exit_sedlbauer_cs(void) static void __exit exit_sedlbauer_cs(void)
{ {
pcmcia_unregister_driver(&sedlbauer_driver); pcmcia_unregister_driver(&sedlbauer_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_sedlbauer_cs); module_init(init_sedlbauer_cs);
......
...@@ -107,18 +107,7 @@ static dev_info_t dev_info = "teles_cs"; ...@@ -107,18 +107,7 @@ static dev_info_t dev_info = "teles_cs";
device numbers are used to derive the corresponding array index. device numbers are used to derive the corresponding array index.
*/ */
static dev_link_t *dev_list = NULL;
/* /*
A dev_link_t structure has fields for most things that are needed
to keep track of a socket, but there will usually be some device
specific information that also needs to be kept track of. The
'priv' pointer in a dev_link_t structure can be used to point to
a device-specific private data structure, like this.
To simplify the data structure handling, we actually include the
dev_link_t structure in the device's private data structure.
A driver needs to provide a dev_node_t structure for each device A driver needs to provide a dev_node_t structure for each device
on a card. In some cases, there is only one device per card (for on a card. In some cases, there is only one device per card (for
example, ethernet cards, modems). In other cases, there may be example, ethernet cards, modems). In other cases, there may be
...@@ -189,8 +178,7 @@ static dev_link_t *teles_attach(void) ...@@ -189,8 +178,7 @@ static dev_link_t *teles_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -216,24 +204,15 @@ static dev_link_t *teles_attach(void) ...@@ -216,24 +204,15 @@ static dev_link_t *teles_attach(void)
static void teles_detach(struct pcmcia_device *p_dev) static void teles_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
local_info_t *info = link->priv; local_info_t *info = link->priv;
DEBUG(0, "teles_detach(0x%p)\n", link); DEBUG(0, "teles_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
info->busy = 1; info->busy = 1;
teles_cs_release(link); teles_cs_release(link);
} }
/* Unlink device structure and free it */
*linkp = link->next;
kfree(info); kfree(info);
} /* teles_detach */ } /* teles_detach */
...@@ -506,7 +485,6 @@ static int __init init_teles_cs(void) ...@@ -506,7 +485,6 @@ static int __init init_teles_cs(void)
static void __exit exit_teles_cs(void) static void __exit exit_teles_cs(void)
{ {
pcmcia_unregister_driver(&teles_cs_driver); pcmcia_unregister_driver(&teles_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_teles_cs); module_init(init_teles_cs);
......
...@@ -67,7 +67,6 @@ struct pcmciamtd_dev { ...@@ -67,7 +67,6 @@ struct pcmciamtd_dev {
static dev_info_t dev_info = "pcmciamtd"; static dev_info_t dev_info = "pcmciamtd";
static dev_link_t *dev_list;
/* Module parameters */ /* Module parameters */
...@@ -782,8 +781,7 @@ static dev_link_t *pcmciamtd_attach(void) ...@@ -782,8 +781,7 @@ static dev_link_t *pcmciamtd_attach(void)
link->conf.Attributes = 0; link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY; link->conf.IntType = INT_MEMORY;
link->next = dev_list; link->next = NULL;
dev_list = link;
/* Register with Card Services */ /* Register with Card Services */
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
...@@ -865,7 +863,6 @@ static void __exit exit_pcmciamtd(void) ...@@ -865,7 +863,6 @@ static void __exit exit_pcmciamtd(void)
{ {
DEBUG(1, DRIVER_DESC " unloading"); DEBUG(1, DRIVER_DESC " unloading");
pcmcia_unregister_driver(&pcmciamtd_driver); pcmcia_unregister_driver(&pcmciamtd_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_pcmciamtd); module_init(init_pcmciamtd);
......
...@@ -255,8 +255,6 @@ static dev_info_t dev_info = "3c574_cs"; ...@@ -255,8 +255,6 @@ static dev_info_t dev_info = "3c574_cs";
static dev_link_t *tc574_attach(void); static dev_link_t *tc574_attach(void);
static void tc574_detach(struct pcmcia_device *p_dev); static void tc574_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list;
/* /*
tc574_attach() creates an "instance" of the driver, allocating tc574_attach() creates an "instance" of the driver, allocating
local data structures for one device. The device is registered local data structures for one device. The device is registered
...@@ -308,8 +306,7 @@ static dev_link_t *tc574_attach(void) ...@@ -308,8 +306,7 @@ static dev_link_t *tc574_attach(void)
#endif #endif
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -336,24 +333,15 @@ static void tc574_detach(struct pcmcia_device *p_dev) ...@@ -336,24 +333,15 @@ static void tc574_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "3c574_detach(0x%p)\n", link); DEBUG(0, "3c574_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
tc574_release(link); tc574_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
free_netdev(dev); free_netdev(dev);
} /* tc574_detach */ } /* tc574_detach */
...@@ -1310,7 +1298,6 @@ static int __init init_tc574(void) ...@@ -1310,7 +1298,6 @@ static int __init init_tc574(void)
static void __exit exit_tc574(void) static void __exit exit_tc574(void)
{ {
pcmcia_unregister_driver(&tc574_driver); pcmcia_unregister_driver(&tc574_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_tc574); module_init(init_tc574);
......
...@@ -166,8 +166,6 @@ static dev_info_t dev_info = "3c589_cs"; ...@@ -166,8 +166,6 @@ static dev_info_t dev_info = "3c589_cs";
static dev_link_t *tc589_attach(void); static dev_link_t *tc589_attach(void);
static void tc589_detach(struct pcmcia_device *p_dev); static void tc589_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list;
/*====================================================================== /*======================================================================
tc589_attach() creates an "instance" of the driver, allocating tc589_attach() creates an "instance" of the driver, allocating
...@@ -222,8 +220,7 @@ static dev_link_t *tc589_attach(void) ...@@ -222,8 +220,7 @@ static dev_link_t *tc589_attach(void)
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -250,24 +247,15 @@ static void tc589_detach(struct pcmcia_device *p_dev) ...@@ -250,24 +247,15 @@ static void tc589_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "3c589_detach(0x%p)\n", link); DEBUG(0, "3c589_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
tc589_release(link); tc589_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
free_netdev(dev); free_netdev(dev);
} /* tc589_detach */ } /* tc589_detach */
...@@ -1085,7 +1073,6 @@ static int __init init_tc589(void) ...@@ -1085,7 +1073,6 @@ static int __init init_tc589(void)
static void __exit exit_tc589(void) static void __exit exit_tc589(void)
{ {
pcmcia_unregister_driver(&tc589_driver); pcmcia_unregister_driver(&tc589_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_tc589); module_init(init_tc589);
......
...@@ -111,7 +111,6 @@ static dev_link_t *axnet_attach(void); ...@@ -111,7 +111,6 @@ static dev_link_t *axnet_attach(void);
static void axnet_detach(struct pcmcia_device *p_dev); static void axnet_detach(struct pcmcia_device *p_dev);
static dev_info_t dev_info = "axnet_cs"; static dev_info_t dev_info = "axnet_cs";
static dev_link_t *dev_list;
static void axdev_setup(struct net_device *dev); static void axdev_setup(struct net_device *dev);
static void AX88190_init(struct net_device *dev, int startp); static void AX88190_init(struct net_device *dev, int startp);
...@@ -177,8 +176,7 @@ static dev_link_t *axnet_attach(void) ...@@ -177,8 +176,7 @@ static dev_link_t *axnet_attach(void)
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -205,24 +203,15 @@ static void axnet_detach(struct pcmcia_device *p_dev) ...@@ -205,24 +203,15 @@ static void axnet_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "axnet_detach(0x%p)\n", link); DEBUG(0, "axnet_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
axnet_release(link); axnet_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
free_netdev(dev); free_netdev(dev);
} /* axnet_detach */ } /* axnet_detach */
...@@ -896,7 +885,6 @@ static int __init init_axnet_cs(void) ...@@ -896,7 +885,6 @@ static int __init init_axnet_cs(void)
static void __exit exit_axnet_cs(void) static void __exit exit_axnet_cs(void)
{ {
pcmcia_unregister_driver(&axnet_cs_driver); pcmcia_unregister_driver(&axnet_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_axnet_cs); module_init(init_axnet_cs);
......
...@@ -128,8 +128,6 @@ static dev_info_t dev_info = "com20020_cs"; ...@@ -128,8 +128,6 @@ static dev_info_t dev_info = "com20020_cs";
static dev_link_t *com20020_attach(void); static dev_link_t *com20020_attach(void);
static void com20020_detach(struct pcmcia_device *p_dev); static void com20020_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list;
/*====================================================================*/ /*====================================================================*/
typedef struct com20020_dev_t { typedef struct com20020_dev_t {
...@@ -196,8 +194,7 @@ static dev_link_t *com20020_attach(void) ...@@ -196,8 +194,7 @@ static dev_link_t *com20020_attach(void)
link->priv = info; link->priv = info;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -230,21 +227,12 @@ static void com20020_detach(struct pcmcia_device *p_dev) ...@@ -230,21 +227,12 @@ static void com20020_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct com20020_dev_t *info = link->priv; struct com20020_dev_t *info = link->priv;
dev_link_t **linkp; struct net_device *dev = info->dev;
struct net_device *dev;
DEBUG(1,"detach...\n"); DEBUG(1,"detach...\n");
DEBUG(0, "com20020_detach(0x%p)\n", link); DEBUG(0, "com20020_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
dev = info->dev;
if (link->dev) { if (link->dev) {
DEBUG(1,"unregister...\n"); DEBUG(1,"unregister...\n");
...@@ -263,7 +251,6 @@ static void com20020_detach(struct pcmcia_device *p_dev) ...@@ -263,7 +251,6 @@ static void com20020_detach(struct pcmcia_device *p_dev)
/* Unlink device structure, free bits */ /* Unlink device structure, free bits */
DEBUG(1,"unlinking...\n"); DEBUG(1,"unlinking...\n");
*linkp = link->next;
if (link->priv) if (link->priv)
{ {
dev = info->dev; dev = info->dev;
...@@ -507,7 +494,6 @@ static int __init init_com20020_cs(void) ...@@ -507,7 +494,6 @@ static int __init init_com20020_cs(void)
static void __exit exit_com20020_cs(void) static void __exit exit_com20020_cs(void)
{ {
pcmcia_unregister_driver(&com20020_cs_driver); pcmcia_unregister_driver(&com20020_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_com20020_cs); module_init(init_com20020_cs);
......
...@@ -109,7 +109,6 @@ static void fjn_tx_timeout(struct net_device *dev); ...@@ -109,7 +109,6 @@ static void fjn_tx_timeout(struct net_device *dev);
static struct ethtool_ops netdev_ethtool_ops; static struct ethtool_ops netdev_ethtool_ops;
static dev_info_t dev_info = "fmvj18x_cs"; static dev_info_t dev_info = "fmvj18x_cs";
static dev_link_t *dev_list;
/* /*
card type card type
...@@ -283,8 +282,7 @@ static dev_link_t *fmvj18x_attach(void) ...@@ -283,8 +282,7 @@ static dev_link_t *fmvj18x_attach(void)
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -304,24 +302,15 @@ static void fmvj18x_detach(struct pcmcia_device *p_dev) ...@@ -304,24 +302,15 @@ static void fmvj18x_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "fmvj18x_detach(0x%p)\n", link); DEBUG(0, "fmvj18x_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
fmvj18x_release(link); fmvj18x_release(link);
/* Unlink device structure, free pieces */
*linkp = link->next;
free_netdev(dev); free_netdev(dev);
} /* fmvj18x_detach */ } /* fmvj18x_detach */
...@@ -807,7 +796,6 @@ static int __init init_fmvj18x_cs(void) ...@@ -807,7 +796,6 @@ static int __init init_fmvj18x_cs(void)
static void __exit exit_fmvj18x_cs(void) static void __exit exit_fmvj18x_cs(void)
{ {
pcmcia_unregister_driver(&fmvj18x_cs_driver); pcmcia_unregister_driver(&fmvj18x_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_fmvj18x_cs); module_init(init_fmvj18x_cs);
......
...@@ -116,8 +116,6 @@ static dev_info_t dev_info = "ibmtr_cs"; ...@@ -116,8 +116,6 @@ static dev_info_t dev_info = "ibmtr_cs";
static dev_link_t *ibmtr_attach(void); static dev_link_t *ibmtr_attach(void);
static void ibmtr_detach(struct pcmcia_device *p_dev); static void ibmtr_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list;
/*====================================================================*/ /*====================================================================*/
typedef struct ibmtr_dev_t { typedef struct ibmtr_dev_t {
...@@ -186,8 +184,7 @@ static dev_link_t *ibmtr_attach(void) ...@@ -186,8 +184,7 @@ static dev_link_t *ibmtr_attach(void)
SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -219,19 +216,10 @@ static void ibmtr_detach(struct pcmcia_device *p_dev) ...@@ -219,19 +216,10 @@ static void ibmtr_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct ibmtr_dev_t *info = link->priv; struct ibmtr_dev_t *info = link->priv;
dev_link_t **linkp; struct net_device *dev = info->dev;
struct net_device *dev;
DEBUG(0, "ibmtr_detach(0x%p)\n", link); DEBUG(0, "ibmtr_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
dev = info->dev;
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
...@@ -242,8 +230,6 @@ static void ibmtr_detach(struct pcmcia_device *p_dev) ...@@ -242,8 +230,6 @@ static void ibmtr_detach(struct pcmcia_device *p_dev)
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
ibmtr_release(link); ibmtr_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
free_netdev(dev); free_netdev(dev);
kfree(info); kfree(info);
} /* ibmtr_detach */ } /* ibmtr_detach */
...@@ -530,7 +516,6 @@ static int __init init_ibmtr_cs(void) ...@@ -530,7 +516,6 @@ static int __init init_ibmtr_cs(void)
static void __exit exit_ibmtr_cs(void) static void __exit exit_ibmtr_cs(void)
{ {
pcmcia_unregister_driver(&ibmtr_cs_driver); pcmcia_unregister_driver(&ibmtr_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_ibmtr_cs); module_init(init_ibmtr_cs);
......
...@@ -389,7 +389,6 @@ DRV_NAME " " DRV_VERSION " (Roger C. Pao)"; ...@@ -389,7 +389,6 @@ DRV_NAME " " DRV_VERSION " (Roger C. Pao)";
#endif #endif
static dev_info_t dev_info="nmclan_cs"; static dev_info_t dev_info="nmclan_cs";
static dev_link_t *dev_list;
static char *if_names[]={ static char *if_names[]={
"Auto", "10baseT", "BNC", "Auto", "10baseT", "BNC",
...@@ -498,8 +497,7 @@ static dev_link_t *nmclan_attach(void) ...@@ -498,8 +497,7 @@ static dev_link_t *nmclan_attach(void)
#endif #endif
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -525,24 +523,15 @@ static void nmclan_detach(struct pcmcia_device *p_dev) ...@@ -525,24 +523,15 @@ static void nmclan_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "nmclan_detach(0x%p)\n", link); DEBUG(0, "nmclan_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
nmclan_release(link); nmclan_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
free_netdev(dev); free_netdev(dev);
} /* nmclan_detach */ } /* nmclan_detach */
...@@ -1700,7 +1689,6 @@ static int __init init_nmclan_cs(void) ...@@ -1700,7 +1689,6 @@ static int __init init_nmclan_cs(void)
static void __exit exit_nmclan_cs(void) static void __exit exit_nmclan_cs(void)
{ {
pcmcia_unregister_driver(&nmclan_cs_driver); pcmcia_unregister_driver(&nmclan_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_nmclan_cs); module_init(init_nmclan_cs);
......
...@@ -124,7 +124,6 @@ static dev_link_t *pcnet_attach(void); ...@@ -124,7 +124,6 @@ static dev_link_t *pcnet_attach(void);
static void pcnet_detach(struct pcmcia_device *p_dev); static void pcnet_detach(struct pcmcia_device *p_dev);
static dev_info_t dev_info = "pcnet_cs"; static dev_info_t dev_info = "pcnet_cs";
static dev_link_t *dev_list;
/*====================================================================*/ /*====================================================================*/
...@@ -272,8 +271,7 @@ static dev_link_t *pcnet_attach(void) ...@@ -272,8 +271,7 @@ static dev_link_t *pcnet_attach(void)
dev->set_config = &set_config; dev->set_config = &set_config;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -300,24 +298,15 @@ static void pcnet_detach(struct pcmcia_device *p_dev) ...@@ -300,24 +298,15 @@ static void pcnet_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "pcnet_detach(0x%p)\n", link); DEBUG(0, "pcnet_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
pcnet_release(link); pcnet_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
free_netdev(dev); free_netdev(dev);
} /* pcnet_detach */ } /* pcnet_detach */
...@@ -1864,7 +1853,6 @@ static void __exit exit_pcnet_cs(void) ...@@ -1864,7 +1853,6 @@ static void __exit exit_pcnet_cs(void)
{ {
DEBUG(0, "pcnet_cs: unloading\n"); DEBUG(0, "pcnet_cs: unloading\n");
pcmcia_unregister_driver(&pcnet_driver); pcmcia_unregister_driver(&pcnet_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_pcnet_cs); module_init(init_pcnet_cs);
......
...@@ -104,8 +104,6 @@ static const char *version = ...@@ -104,8 +104,6 @@ static const char *version =
static dev_info_t dev_info = "smc91c92_cs"; static dev_info_t dev_info = "smc91c92_cs";
static dev_link_t *dev_list;
struct smc_private { struct smc_private {
dev_link_t link; dev_link_t link;
spinlock_t lock; spinlock_t lock;
...@@ -367,8 +365,7 @@ static dev_link_t *smc91c92_attach(void) ...@@ -367,8 +365,7 @@ static dev_link_t *smc91c92_attach(void)
smc->mii_if.reg_num_mask = 0x1f; smc->mii_if.reg_num_mask = 0x1f;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -395,24 +392,15 @@ static void smc91c92_detach(struct pcmcia_device *p_dev) ...@@ -395,24 +392,15 @@ static void smc91c92_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "smc91c92_detach(0x%p)\n", link); DEBUG(0, "smc91c92_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
smc91c92_release(link); smc91c92_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
free_netdev(dev); free_netdev(dev);
} /* smc91c92_detach */ } /* smc91c92_detach */
...@@ -2377,7 +2365,6 @@ static int __init init_smc91c92_cs(void) ...@@ -2377,7 +2365,6 @@ static int __init init_smc91c92_cs(void)
static void __exit exit_smc91c92_cs(void) static void __exit exit_smc91c92_cs(void)
{ {
pcmcia_unregister_driver(&smc91c92_cs_driver); pcmcia_unregister_driver(&smc91c92_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_smc91c92_cs); module_init(init_smc91c92_cs);
......
...@@ -331,15 +331,7 @@ static dev_info_t dev_info = "xirc2ps_cs"; ...@@ -331,15 +331,7 @@ static dev_info_t dev_info = "xirc2ps_cs";
* device numbers are used to derive the corresponding array index. * device numbers are used to derive the corresponding array index.
*/ */
static dev_link_t *dev_list;
/**************** /****************
* A dev_link_t structure has fields for most things that are needed
* to keep track of a socket, but there will usually be some device
* specific information that also needs to be kept track of. The
* 'priv' pointer in a dev_link_t structure can be used to point to
* a device-specific private data structure, like this.
*
* A driver needs to provide a dev_node_t structure for each device * A driver needs to provide a dev_node_t structure for each device
* on a card. In some cases, there is only one device per card (for * on a card. In some cases, there is only one device per card (for
* example, ethernet cards, modems). In other cases, there may be * example, ethernet cards, modems). In other cases, there may be
...@@ -615,8 +607,7 @@ xirc2ps_attach(void) ...@@ -615,8 +607,7 @@ xirc2ps_attach(void)
#endif #endif
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -641,27 +632,15 @@ xirc2ps_detach(struct pcmcia_device *p_dev) ...@@ -641,27 +632,15 @@ xirc2ps_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "detach(0x%p)\n", link); DEBUG(0, "detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (!*linkp) {
DEBUG(0, "detach(0x%p): dev_link lost\n", link);
return;
}
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
xirc2ps_release(link); xirc2ps_release(link);
/* Unlink device structure, free it */
*linkp = link->next;
free_netdev(dev); free_netdev(dev);
} /* xirc2ps_detach */ } /* xirc2ps_detach */
...@@ -2020,7 +1999,6 @@ static void __exit ...@@ -2020,7 +1999,6 @@ static void __exit
exit_xirc2ps_cs(void) exit_xirc2ps_cs(void)
{ {
pcmcia_unregister_driver(&xirc2ps_cs_driver); pcmcia_unregister_driver(&xirc2ps_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_xirc2ps_cs); module_init(init_xirc2ps_cs);
......
...@@ -119,15 +119,7 @@ static dev_info_t dev_info = "airo_cs"; ...@@ -119,15 +119,7 @@ static dev_info_t dev_info = "airo_cs";
device numbers are used to derive the corresponding array index. device numbers are used to derive the corresponding array index.
*/ */
static dev_link_t *dev_list = NULL;
/* /*
A dev_link_t structure has fields for most things that are needed
to keep track of a socket, but there will usually be some device
specific information that also needs to be kept track of. The
'priv' pointer in a dev_link_t structure can be used to point to
a device-specific private data structure, like this.
A driver needs to provide a dev_node_t structure for each device A driver needs to provide a dev_node_t structure for each device
on a card. In some cases, there is only one device per card (for on a card. In some cases, there is only one device per card (for
example, ethernet cards, modems). In other cases, there may be example, ethernet cards, modems). In other cases, there may be
...@@ -202,8 +194,7 @@ static dev_link_t *airo_attach(void) ...@@ -202,8 +194,7 @@ static dev_link_t *airo_attach(void)
link->priv = local; link->priv = local;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -229,16 +220,9 @@ static dev_link_t *airo_attach(void) ...@@ -229,16 +220,9 @@ static dev_link_t *airo_attach(void)
static void airo_detach(struct pcmcia_device *p_dev) static void airo_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DEBUG(0, "airo_detach(0x%p)\n", link); DEBUG(0, "airo_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
airo_release(link); airo_release(link);
...@@ -247,11 +231,8 @@ static void airo_detach(struct pcmcia_device *p_dev) ...@@ -247,11 +231,8 @@ static void airo_detach(struct pcmcia_device *p_dev)
} }
((local_info_t*)link->priv)->eth_dev = NULL; ((local_info_t*)link->priv)->eth_dev = NULL;
/* Unlink device structure, free pieces */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
kfree(link); kfree(link);
} /* airo_detach */ } /* airo_detach */
/*====================================================================== /*======================================================================
...@@ -574,7 +555,6 @@ static int airo_cs_init(void) ...@@ -574,7 +555,6 @@ static int airo_cs_init(void)
static void airo_cs_cleanup(void) static void airo_cs_cleanup(void)
{ {
pcmcia_unregister_driver(&airo_driver); pcmcia_unregister_driver(&airo_driver);
BUG_ON(dev_list != NULL);
} }
/* /*
......
...@@ -130,15 +130,7 @@ static dev_info_t dev_info = "atmel_cs"; ...@@ -130,15 +130,7 @@ static dev_info_t dev_info = "atmel_cs";
device numbers are used to derive the corresponding array index. device numbers are used to derive the corresponding array index.
*/ */
static dev_link_t *dev_list = NULL;
/* /*
A dev_link_t structure has fields for most things that are needed
to keep track of a socket, but there will usually be some device
specific information that also needs to be kept track of. The
'priv' pointer in a dev_link_t structure can be used to point to
a device-specific private data structure, like this.
A driver needs to provide a dev_node_t structure for each device A driver needs to provide a dev_node_t structure for each device
on a card. In some cases, there is only one device per card (for on a card. In some cases, there is only one device per card (for
example, ethernet cards, modems). In other cases, there may be example, ethernet cards, modems). In other cases, there may be
...@@ -213,8 +205,7 @@ static dev_link_t *atmel_attach(void) ...@@ -213,8 +205,7 @@ static dev_link_t *atmel_attach(void)
link->priv = local; link->priv = local;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -240,21 +231,12 @@ static dev_link_t *atmel_attach(void) ...@@ -240,21 +231,12 @@ static dev_link_t *atmel_attach(void)
static void atmel_detach(struct pcmcia_device *p_dev) static void atmel_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DEBUG(0, "atmel_detach(0x%p)\n", link); DEBUG(0, "atmel_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
atmel_release(link); atmel_release(link);
/* Unlink device structure, free pieces */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
kfree(link); kfree(link);
} }
...@@ -596,7 +578,6 @@ static int atmel_cs_init(void) ...@@ -596,7 +578,6 @@ static int atmel_cs_init(void)
static void atmel_cs_cleanup(void) static void atmel_cs_cleanup(void)
{ {
pcmcia_unregister_driver(&atmel_driver); pcmcia_unregister_driver(&atmel_driver);
BUG_ON(dev_list != NULL);
} }
/* /*
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
static char *version = PRISM2_VERSION " (Jouni Malinen <jkmaline@cc.hut.fi>)"; static char *version = PRISM2_VERSION " (Jouni Malinen <jkmaline@cc.hut.fi>)";
static dev_info_t dev_info = "hostap_cs"; static dev_info_t dev_info = "hostap_cs";
static dev_link_t *dev_list = NULL;
MODULE_AUTHOR("Jouni Malinen"); MODULE_AUTHOR("Jouni Malinen");
MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN " MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN "
...@@ -520,8 +519,7 @@ static dev_link_t *prism2_attach(void) ...@@ -520,8 +519,7 @@ static dev_link_t *prism2_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* register with CardServices */ /* register with CardServices */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -538,24 +536,13 @@ static dev_link_t *prism2_attach(void) ...@@ -538,24 +536,13 @@ static dev_link_t *prism2_attach(void)
static void prism2_detach(struct pcmcia_device *p_dev) static void prism2_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
PDEBUG(DEBUG_FLOW, "prism2_detach\n"); PDEBUG(DEBUG_FLOW, "prism2_detach\n");
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (*linkp == NULL) {
printk(KERN_WARNING "%s: Attempt to detach non-existing "
"PCMCIA client\n", dev_info);
return;
}
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
prism2_release((u_long)link); prism2_release((u_long)link);
} }
*linkp = link->next;
/* release net devices */ /* release net devices */
if (link->priv) { if (link->priv) {
struct hostap_cs_priv *hw_priv; struct hostap_cs_priv *hw_priv;
......
...@@ -227,17 +227,6 @@ static struct iw_statistics* netwave_get_wireless_stats(struct net_device *dev); ...@@ -227,17 +227,6 @@ static struct iw_statistics* netwave_get_wireless_stats(struct net_device *dev);
static void set_multicast_list(struct net_device *dev); static void set_multicast_list(struct net_device *dev);
/*
A linked list of "instances" of the skeleton device. Each actual
PCMCIA card corresponds to one device instance, and is described
by one dev_link_t structure (defined in ds.h).
You may not want to use a linked list for this -- for example, the
memory card driver uses an array of dev_link_t pointers, where minor
device numbers are used to derive the corresponding array index.
*/
static dev_link_t *dev_list;
/* /*
A dev_link_t structure has fields for most things that are needed A dev_link_t structure has fields for most things that are needed
to keep track of a socket, but there will usually be some device to keep track of a socket, but there will usually be some device
...@@ -451,8 +440,7 @@ static dev_link_t *netwave_attach(void) ...@@ -451,8 +440,7 @@ static dev_link_t *netwave_attach(void)
link->irq.Instance = dev; link->irq.Instance = dev;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -478,35 +466,16 @@ static void netwave_detach(struct pcmcia_device *p_dev) ...@@ -478,35 +466,16 @@ static void netwave_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
dev_link_t **linkp;
DEBUG(0, "netwave_detach(0x%p)\n", link); DEBUG(0, "netwave_detach(0x%p)\n", link);
/*
If the device is currently configured and active, we won't
actually delete it yet. Instead, it is marked so that when
the release() function is called, that will trigger a proper
detach().
*/
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
netwave_release(link); netwave_release(link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
{
DEBUG(1, "netwave_cs: detach fail, '%s' not in list\n",
link->dev->dev_name);
return;
}
/* Unlink device structure, free pieces */
*linkp = link->next;
if (link->dev) if (link->dev)
unregister_netdev(dev); unregister_netdev(dev);
free_netdev(dev);
free_netdev(dev);
} /* netwave_detach */ } /* netwave_detach */
/* /*
...@@ -1503,7 +1472,6 @@ static int __init init_netwave_cs(void) ...@@ -1503,7 +1472,6 @@ static int __init init_netwave_cs(void)
static void __exit exit_netwave_cs(void) static void __exit exit_netwave_cs(void)
{ {
pcmcia_unregister_driver(&netwave_driver); pcmcia_unregister_driver(&netwave_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_netwave_cs); module_init(init_netwave_cs);
......
...@@ -69,12 +69,6 @@ struct orinoco_pccard { ...@@ -69,12 +69,6 @@ struct orinoco_pccard {
unsigned long hard_reset_in_progress; unsigned long hard_reset_in_progress;
}; };
/*
* A linked list of "instances" of the device. Each actual PCMCIA
* card corresponds to one device instance, and is described by one
* dev_link_t structure (defined in ds.h).
*/
static dev_link_t *dev_list; /* = NULL */
/********************************************************************/ /********************************************************************/
/* Function prototypes */ /* Function prototypes */
...@@ -154,9 +148,7 @@ orinoco_cs_attach(void) ...@@ -154,9 +148,7 @@ orinoco_cs_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
/* FIXME: need a lock? */ link->next = NULL;
link->next = dev_list;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; /* FIXME: what does this mean? */ client_reg.Version = 0x0210; /* FIXME: what does this mean? */
...@@ -181,21 +173,11 @@ orinoco_cs_attach(void) ...@@ -181,21 +173,11 @@ orinoco_cs_attach(void)
static void orinoco_cs_detach(struct pcmcia_device *p_dev) static void orinoco_cs_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
BUG_ON(*linkp == NULL);
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
orinoco_cs_release(link); orinoco_cs_release(link);
/* Unlink device structure, and free it */
*linkp = link->next;
DEBUG(0, PFX "detach: link=%p link->dev=%p\n", link, link->dev); DEBUG(0, PFX "detach: link=%p link->dev=%p\n", link, link->dev);
if (link->dev) { if (link->dev) {
DEBUG(0, PFX "About to unregister net device %p\n", DEBUG(0, PFX "About to unregister net device %p\n",
...@@ -678,7 +660,6 @@ static void __exit ...@@ -678,7 +660,6 @@ static void __exit
exit_orinoco_cs(void) exit_orinoco_cs(void)
{ {
pcmcia_unregister_driver(&orinoco_driver); pcmcia_unregister_driver(&orinoco_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_orinoco_cs); module_init(init_orinoco_cs);
......
...@@ -78,13 +78,6 @@ struct orinoco_pccard { ...@@ -78,13 +78,6 @@ struct orinoco_pccard {
dev_node_t node; dev_node_t node;
}; };
/*
* A linked list of "instances" of the device. Each actual PCMCIA
* card corresponds to one device instance, and is described by one
* dev_link_t structure (defined in ds.h).
*/
static dev_link_t *dev_list; /* = NULL */
/********************************************************************/ /********************************************************************/
/* Function prototypes */ /* Function prototypes */
/********************************************************************/ /********************************************************************/
...@@ -637,8 +630,7 @@ spectrum_cs_attach(void) ...@@ -637,8 +630,7 @@ spectrum_cs_attach(void)
/* Register with Card Services */ /* Register with Card Services */
/* FIXME: need a lock? */ /* FIXME: need a lock? */
link->next = dev_list; link->next = NULL; /* not needed */
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; /* FIXME: what does this mean? */ client_reg.Version = 0x0210; /* FIXME: what does this mean? */
...@@ -1049,7 +1041,6 @@ static void __exit ...@@ -1049,7 +1041,6 @@ static void __exit
exit_spectrum_cs(void) exit_spectrum_cs(void)
{ {
pcmcia_unregister_driver(&orinoco_driver); pcmcia_unregister_driver(&orinoco_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_spectrum_cs); module_init(init_spectrum_cs);
......
...@@ -4627,8 +4627,7 @@ wavelan_attach(void) ...@@ -4627,8 +4627,7 @@ wavelan_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Chain drivers */ /* Chain drivers */
link->next = dev_list; link->next = NULL;
dev_list = link;
/* Allocate the generic data structure */ /* Allocate the generic data structure */
dev = alloc_etherdev(sizeof(net_local)); dev = alloc_etherdev(sizeof(net_local));
...@@ -4731,27 +4730,6 @@ wavelan_detach(struct pcmcia_device *p_dev) ...@@ -4731,27 +4730,6 @@ wavelan_detach(struct pcmcia_device *p_dev)
wv_pcmcia_release(link); wv_pcmcia_release(link);
} }
/* Remove the interface data from the linked list */
if(dev_list == link)
dev_list = link->next;
else
{
dev_link_t * prev = dev_list;
while((prev != (dev_link_t *) NULL) && (prev->next != link))
prev = prev->next;
if(prev == (dev_link_t *) NULL)
{
#ifdef DEBUG_CONFIG_ERRORS
printk(KERN_WARNING "wavelan_detach : Attempting to remove a nonexistent device.\n");
#endif
return;
}
prev->next = link->next;
}
/* Free pieces */ /* Free pieces */
if(link->priv) if(link->priv)
{ {
......
...@@ -766,7 +766,6 @@ static int ...@@ -766,7 +766,6 @@ static int
/**************************** VARIABLES ****************************/ /**************************** VARIABLES ****************************/
static dev_info_t dev_info = "wavelan_cs"; static dev_info_t dev_info = "wavelan_cs";
static dev_link_t *dev_list = NULL; /* Linked list of devices */
/* /*
* Parameters that can be set with 'insmod' * Parameters that can be set with 'insmod'
......
...@@ -95,7 +95,6 @@ static int parport_event(event_t event, int priority, ...@@ -95,7 +95,6 @@ static int parport_event(event_t event, int priority,
event_callback_args_t *args); event_callback_args_t *args);
static dev_info_t dev_info = "parport_cs"; static dev_info_t dev_info = "parport_cs";
static dev_link_t *dev_list = NULL;
/*====================================================================== /*======================================================================
...@@ -129,8 +128,7 @@ static dev_link_t *parport_attach(void) ...@@ -129,8 +128,7 @@ static dev_link_t *parport_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -156,21 +154,12 @@ static dev_link_t *parport_attach(void) ...@@ -156,21 +154,12 @@ static dev_link_t *parport_attach(void)
static void parport_detach(struct pcmcia_device *p_dev) static void parport_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DEBUG(0, "parport_detach(0x%p)\n", link); DEBUG(0, "parport_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
parport_cs_release(link); parport_cs_release(link);
/* Unlink, free device structure */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
} /* parport_detach */ } /* parport_detach */
...@@ -391,7 +380,6 @@ static int __init init_parport_cs(void) ...@@ -391,7 +380,6 @@ static int __init init_parport_cs(void)
static void __exit exit_parport_cs(void) static void __exit exit_parport_cs(void)
{ {
pcmcia_unregister_driver(&parport_cs_driver); pcmcia_unregister_driver(&parport_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_parport_cs); module_init(init_parport_cs);
......
...@@ -87,8 +87,6 @@ static dev_link_t *fdomain_attach(void); ...@@ -87,8 +87,6 @@ static dev_link_t *fdomain_attach(void);
static void fdomain_detach(struct pcmcia_device *p_dev); static void fdomain_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list = NULL;
static dev_info_t dev_info = "fdomain_cs"; static dev_info_t dev_info = "fdomain_cs";
static dev_link_t *fdomain_attach(void) static dev_link_t *fdomain_attach(void)
...@@ -116,8 +114,7 @@ static dev_link_t *fdomain_attach(void) ...@@ -116,8 +114,7 @@ static dev_link_t *fdomain_attach(void)
link->conf.Present = PRESENT_OPTION; link->conf.Present = PRESENT_OPTION;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -136,23 +133,13 @@ static dev_link_t *fdomain_attach(void) ...@@ -136,23 +133,13 @@ static dev_link_t *fdomain_attach(void)
static void fdomain_detach(struct pcmcia_device *p_dev) static void fdomain_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DEBUG(0, "fdomain_detach(0x%p)\n", link); DEBUG(0, "fdomain_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link) break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
fdomain_release(link); fdomain_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
} /* fdomain_detach */ } /* fdomain_detach */
/*====================================================================*/ /*====================================================================*/
...@@ -324,7 +311,6 @@ static int __init init_fdomain_cs(void) ...@@ -324,7 +311,6 @@ static int __init init_fdomain_cs(void)
static void __exit exit_fdomain_cs(void) static void __exit exit_fdomain_cs(void)
{ {
pcmcia_unregister_driver(&fdomain_cs_driver); pcmcia_unregister_driver(&fdomain_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_fdomain_cs); module_init(init_fdomain_cs);
......
...@@ -104,7 +104,6 @@ static struct scsi_host_template nsp_driver_template = { ...@@ -104,7 +104,6 @@ static struct scsi_host_template nsp_driver_template = {
#endif #endif
}; };
static dev_link_t *dev_list = NULL;
static dev_info_t dev_info = {"nsp_cs"}; static dev_info_t dev_info = {"nsp_cs"};
static nsp_hw_data nsp_data_base; /* attach <-> detect glue */ static nsp_hw_data nsp_data_base; /* attach <-> detect glue */
...@@ -1638,8 +1637,7 @@ static dev_link_t *nsp_cs_attach(void) ...@@ -1638,8 +1637,7 @@ static dev_link_t *nsp_cs_attach(void)
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -1665,30 +1663,16 @@ static dev_link_t *nsp_cs_attach(void) ...@@ -1665,30 +1663,16 @@ static dev_link_t *nsp_cs_attach(void)
static void nsp_cs_detach(struct pcmcia_device *p_dev) static void nsp_cs_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link); nsp_dbg(NSP_DEBUG_INIT, "in, link=0x%p", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) {
if (*linkp == link) {
break;
}
}
if (*linkp == NULL) {
return;
}
if (link->state & DEV_CONFIG) { if (link->state & DEV_CONFIG) {
((scsi_info_t *)link->priv)->stop = 1; ((scsi_info_t *)link->priv)->stop = 1;
nsp_cs_release(link); nsp_cs_release(link);
} }
/* Unlink device structure, free bits */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
link->priv = NULL; link->priv = NULL;
} /* nsp_cs_detach */ } /* nsp_cs_detach */
...@@ -2168,7 +2152,6 @@ static void __exit nsp_cs_exit(void) ...@@ -2168,7 +2152,6 @@ static void __exit nsp_cs_exit(void)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68))
pcmcia_unregister_driver(&nsp_driver); pcmcia_unregister_driver(&nsp_driver);
BUG_ON(dev_list != NULL);
#else #else
unregister_pcmcia_driver(&dev_info); unregister_pcmcia_driver(&dev_info);
/* XXX: this really needs to move into generic code.. */ /* XXX: this really needs to move into generic code.. */
......
...@@ -104,8 +104,6 @@ static dev_link_t *qlogic_attach(void); ...@@ -104,8 +104,6 @@ static dev_link_t *qlogic_attach(void);
static void qlogic_detach(struct pcmcia_device *p_dev); static void qlogic_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list = NULL;
static dev_info_t dev_info = "qlogic_cs"; static dev_info_t dev_info = "qlogic_cs";
static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host, static struct Scsi_Host *qlogic_detect(struct scsi_host_template *host,
...@@ -190,8 +188,7 @@ static dev_link_t *qlogic_attach(void) ...@@ -190,8 +188,7 @@ static dev_link_t *qlogic_attach(void)
link->conf.Present = PRESENT_OPTION; link->conf.Present = PRESENT_OPTION;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -210,22 +207,12 @@ static dev_link_t *qlogic_attach(void) ...@@ -210,22 +207,12 @@ static dev_link_t *qlogic_attach(void)
static void qlogic_detach(struct pcmcia_device *p_dev) static void qlogic_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DEBUG(0, "qlogic_detach(0x%p)\n", link); DEBUG(0, "qlogic_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
qlogic_release(link); qlogic_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
} /* qlogic_detach */ } /* qlogic_detach */
...@@ -439,7 +426,6 @@ static int __init init_qlogic_cs(void) ...@@ -439,7 +426,6 @@ static int __init init_qlogic_cs(void)
static void __exit exit_qlogic_cs(void) static void __exit exit_qlogic_cs(void)
{ {
pcmcia_unregister_driver(&qlogic_cs_driver); pcmcia_unregister_driver(&qlogic_cs_driver);
BUG_ON(dev_list != NULL);
} }
MODULE_AUTHOR("Tom Zerucha, Michael Griffith"); MODULE_AUTHOR("Tom Zerucha, Michael Griffith");
......
...@@ -232,7 +232,6 @@ enum Phase { ...@@ -232,7 +232,6 @@ enum Phase {
* Global (within this module) variables other than * Global (within this module) variables other than
* sym53c500_driver_template (the scsi_host_template). * sym53c500_driver_template (the scsi_host_template).
*/ */
static dev_link_t *dev_list;
static dev_info_t dev_info = "sym53c500_cs"; static dev_info_t dev_info = "sym53c500_cs";
/* ================================================================== */ /* ================================================================== */
...@@ -930,22 +929,12 @@ static void ...@@ -930,22 +929,12 @@ static void
SYM53C500_detach(struct pcmcia_device *p_dev) SYM53C500_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DEBUG(0, "SYM53C500_detach(0x%p)\n", link); DEBUG(0, "SYM53C500_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (*linkp == NULL)
return;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
SYM53C500_release(link); SYM53C500_release(link);
/* Unlink device structure, free bits. */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
link->priv = NULL; link->priv = NULL;
} /* SYM53C500_detach */ } /* SYM53C500_detach */
...@@ -978,8 +967,7 @@ SYM53C500_attach(void) ...@@ -978,8 +967,7 @@ SYM53C500_attach(void)
link->conf.Present = PRESENT_OPTION; link->conf.Present = PRESENT_OPTION;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
......
...@@ -122,8 +122,6 @@ static dev_info_t dev_info = "serial_cs"; ...@@ -122,8 +122,6 @@ static dev_info_t dev_info = "serial_cs";
static dev_link_t *serial_attach(void); static dev_link_t *serial_attach(void);
static void serial_detach(struct pcmcia_device *p_dev); static void serial_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list = NULL;
/*====================================================================== /*======================================================================
After a card is removed, serial_remove() will unregister After a card is removed, serial_remove() will unregister
...@@ -234,8 +232,7 @@ static dev_link_t *serial_attach(void) ...@@ -234,8 +232,7 @@ static dev_link_t *serial_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL; /* not needed */
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -262,17 +259,9 @@ static void serial_detach(struct pcmcia_device *p_dev) ...@@ -262,17 +259,9 @@ static void serial_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
struct serial_info *info = link->priv; struct serial_info *info = link->priv;
dev_link_t **linkp;
DEBUG(0, "serial_detach(0x%p)\n", link); DEBUG(0, "serial_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (*linkp == NULL)
return;
/* /*
* Ensure any outstanding scheduled tasks are completed. * Ensure any outstanding scheduled tasks are completed.
*/ */
...@@ -283,8 +272,7 @@ static void serial_detach(struct pcmcia_device *p_dev) ...@@ -283,8 +272,7 @@ static void serial_detach(struct pcmcia_device *p_dev)
*/ */
serial_remove(link); serial_remove(link);
/* Unlink device structure, free bits */ /* free bits */
*linkp = link->next;
kfree(info); kfree(info);
} }
...@@ -871,7 +859,6 @@ static int __init init_serial_cs(void) ...@@ -871,7 +859,6 @@ static int __init init_serial_cs(void)
static void __exit exit_serial_cs(void) static void __exit exit_serial_cs(void)
{ {
pcmcia_unregister_driver(&serial_cs_driver); pcmcia_unregister_driver(&serial_cs_driver);
BUG_ON(dev_list != NULL);
} }
module_init(init_serial_cs); module_init(init_serial_cs);
......
...@@ -40,7 +40,6 @@ static void ixj_config(dev_link_t * link); ...@@ -40,7 +40,6 @@ static void ixj_config(dev_link_t * link);
static void ixj_cs_release(dev_link_t * link); static void ixj_cs_release(dev_link_t * link);
static int ixj_event(event_t event, int priority, event_callback_args_t * args); static int ixj_event(event_t event, int priority, event_callback_args_t * args);
static dev_info_t dev_info = "ixj_cs"; static dev_info_t dev_info = "ixj_cs";
static dev_link_t *dev_list = NULL;
static dev_link_t *ixj_attach(void) static dev_link_t *ixj_attach(void)
{ {
...@@ -65,8 +64,7 @@ static dev_link_t *ixj_attach(void) ...@@ -65,8 +64,7 @@ static dev_link_t *ixj_attach(void)
} }
memset(link->priv, 0, sizeof(struct ixj_info_t)); memset(link->priv, 0, sizeof(struct ixj_info_t));
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = &dev_info; client_reg.dev_info = &dev_info;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
client_reg.event_callback_args.client_data = link; client_reg.event_callback_args.client_data = link;
...@@ -82,20 +80,13 @@ static dev_link_t *ixj_attach(void) ...@@ -82,20 +80,13 @@ static dev_link_t *ixj_attach(void)
static void ixj_detach(struct pcmcia_device *p_dev) static void ixj_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DEBUG(0, "ixj_detach(0x%p)\n", link); DEBUG(0, "ixj_detach(0x%p)\n", link);
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (*linkp == NULL)
return;
link->state &= ~DEV_RELEASE_PENDING; link->state &= ~DEV_RELEASE_PENDING;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
ixj_cs_release(link); ixj_cs_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
kfree(link->priv); kfree(link->priv);
kfree(link); kfree(link);
} }
...@@ -314,7 +305,6 @@ static int __init ixj_pcmcia_init(void) ...@@ -314,7 +305,6 @@ static int __init ixj_pcmcia_init(void)
static void ixj_pcmcia_exit(void) static void ixj_pcmcia_exit(void)
{ {
pcmcia_unregister_driver(&ixj_driver); pcmcia_unregister_driver(&ixj_driver);
BUG_ON(dev_list != NULL);
} }
module_init(ixj_pcmcia_init); module_init(ixj_pcmcia_init);
......
...@@ -66,8 +66,6 @@ module_param(pc_debug, int, 0644); ...@@ -66,8 +66,6 @@ module_param(pc_debug, int, 0644);
static const char driver_name[DEV_NAME_LEN] = "sl811_cs"; static const char driver_name[DEV_NAME_LEN] = "sl811_cs";
static dev_link_t *dev_list = NULL;
typedef struct local_info_t { typedef struct local_info_t {
dev_link_t link; dev_link_t link;
dev_node_t node; dev_node_t node;
...@@ -143,24 +141,13 @@ static int sl811_hc_init(struct device *parent, ioaddr_t base_addr, int irq) ...@@ -143,24 +141,13 @@ static int sl811_hc_init(struct device *parent, ioaddr_t base_addr, int irq)
static void sl811_cs_detach(struct pcmcia_device *p_dev) static void sl811_cs_detach(struct pcmcia_device *p_dev)
{ {
dev_link_t *link = dev_to_instance(p_dev); dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
DBG(0, "sl811_cs_detach(0x%p)\n", link); DBG(0, "sl811_cs_detach(0x%p)\n", link);
/* Locate device structure */
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) {
if (*linkp == link)
break;
}
if (*linkp == NULL)
return;
link->state &= ~DEV_PRESENT; link->state &= ~DEV_PRESENT;
if (link->state & DEV_CONFIG) if (link->state & DEV_CONFIG)
sl811_cs_release(link); sl811_cs_release(link);
/* Unlink device structure, and free it */
*linkp = link->next;
/* This points to the parent local_info_t struct */ /* This points to the parent local_info_t struct */
kfree(link->priv); kfree(link->priv);
} }
...@@ -378,8 +365,7 @@ static dev_link_t *sl811_cs_attach(void) ...@@ -378,8 +365,7 @@ static dev_link_t *sl811_cs_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO; link->conf.IntType = INT_MEMORY_AND_IO;
/* Register with Card Services */ /* Register with Card Services */
link->next = dev_list; link->next = NULL;
dev_list = link;
client_reg.dev_info = (dev_info_t *) &driver_name; client_reg.dev_info = (dev_info_t *) &driver_name;
client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
client_reg.Version = 0x0210; client_reg.Version = 0x0210;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment