Commit bfdb07ae authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[PATCH] convert remaining register_pcmcia_driver users

Convert remaining register_pcmcia_driver users to use the new
pcmcia_register_driver interfaces.
parent d028fce0
...@@ -626,26 +626,25 @@ static int airo_event(event_t event, int priority, ...@@ -626,26 +626,25 @@ static int airo_event(event_t event, int priority,
return 0; return 0;
} /* airo_event */ } /* airo_event */
/*====================================================================*/ static struct pcmcia_driver airo_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "airo_cs",
},
.attach = airo_attach,
.detach = airo_detach,
};
static int airo_cs_init(void) static int airo_cs_init(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&airo_driver);
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "airo_cs: Card Services release "
"does not match!\n");
return -1;
}
register_pcmcia_driver(&dev_info, &airo_attach, &airo_detach);
return 0;
} }
static void airo_cs_cleanup(void) static void airo_cs_cleanup(void)
{ {
DEBUG(0, "airo_cs: unloading\n"); pcmcia_unregister_driver(&airo_driver);
unregister_pcmcia_driver(&dev_info);
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL) { while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG) if (dev_list->state & DEV_CONFIG)
airo_release((u_long)dev_list); airo_release((u_long)dev_list);
......
...@@ -2962,12 +2962,21 @@ static int write_int(struct file *file, const char *buffer, unsigned long count, ...@@ -2962,12 +2962,21 @@ static int write_int(struct file *file, const char *buffer, unsigned long count,
} }
#endif #endif
static struct pcmcia_driver ray_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "ray_cs",
},
.attach = ray_attach,
.detach = ray_detach,
};
static int __init init_ray_cs(void) static int __init init_ray_cs(void)
{ {
int rc; int rc;
DEBUG(1, "%s\n", rcsid); DEBUG(1, "%s\n", rcsid);
rc = register_pcmcia_driver(&dev_info, &ray_attach, &ray_detach); rc = pcmcia_register_driver(&ray_driver);
DEBUG(1, "raylink init_module register_pcmcia_driver returns 0x%x\n",rc); DEBUG(1, "raylink init_module register_pcmcia_driver returns 0x%x\n",rc);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
...@@ -2993,7 +3002,7 @@ static void __exit exit_ray_cs(void) ...@@ -2993,7 +3002,7 @@ static void __exit exit_ray_cs(void)
remove_proc_entry("ray_cs", proc_root_driver); remove_proc_entry("ray_cs", proc_root_driver);
#endif #endif
unregister_pcmcia_driver(&dev_info); pcmcia_unregister_driver(&ray_driver);
while (dev_list != NULL) while (dev_list != NULL)
ray_detach(dev_list); ray_detach(dev_list);
......
...@@ -1987,32 +1987,26 @@ static int nsp_cs_event(event_t event, ...@@ -1987,32 +1987,26 @@ static int nsp_cs_event(event_t event,
return 0; return 0;
} /* nsp_cs_event */ } /* nsp_cs_event */
/*======================================================================* static struct pcmcia_driver nsp_driver = {
* module entry point .owner = THIS_MODULE,
*====================================================================*/ .drv = {
.name = "nsp_cs",
},
.attach = nsp_cs_attach,
.detach = nsp_cs_detach,
};
static int __init nsp_cs_init(void) static int __init nsp_cs_init(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&nsp_driver);
DEBUG(0, "%s: in\n", __FUNCTION__);
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_DEBUG "nsp_cs: Card Services release "
"does not match!\n");
return -1;
}
register_pcmcia_driver(&dev_info, &nsp_cs_attach, &nsp_cs_detach);
DEBUG(0, "%s: out\n", __FUNCTION__);
return 0;
} }
static void __exit nsp_cs_cleanup(void) static void __exit nsp_cs_exit(void)
{ {
DEBUG(0, "%s: unloading\n", __FUNCTION__); pcmcia_unregister_driver(&nsp_driver);
unregister_pcmcia_driver(&dev_info);
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL) { while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG) { if (dev_list->state & DEV_CONFIG) {
nsp_cs_release((u_long)dev_list); nsp_cs_release((u_long)dev_list);
...@@ -2022,11 +2016,4 @@ static void __exit nsp_cs_cleanup(void) ...@@ -2022,11 +2016,4 @@ static void __exit nsp_cs_cleanup(void)
} }
module_init(nsp_cs_init) module_init(nsp_cs_init)
module_exit(nsp_cs_cleanup) module_exit(nsp_cs_exit)
/*
*
*
*/
/* end */
...@@ -310,29 +310,30 @@ static int ixj_event(event_t event, int priority, event_callback_args_t * args) ...@@ -310,29 +310,30 @@ static int ixj_event(event_t event, int priority, event_callback_args_t * args)
return 0; return 0;
} }
int __init ixj_register_pcmcia(void) static struct pcmcia_driver ixj_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "ixj_cs",
},
.attach = ixj_attach,
.detach = ixj_detach,
};
static int __init ixj_pcmcia_init(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&ixj_driver);
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "ixj_cs: Card Services release does not match!\n");
return -EINVAL;
}
register_pcmcia_driver(&dev_info, &ixj_attach, &ixj_detach);
return 0;
} }
static void ixj_pcmcia_unload(void) static void ixj_pcmcia_exit(void)
{ {
DEBUG(0, "ixj_cs: unloading\n"); pcmcia_unregister_driver(&ixj_driver);
unregister_pcmcia_driver(&dev_info);
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL) while (dev_list != NULL)
ixj_detach(dev_list); ixj_detach(dev_list);
} }
module_init(ixj_register_pcmcia); module_init(ixj_pcmcia_init);
module_exit(ixj_pcmcia_unload); module_exit(ixj_pcmcia_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -141,9 +141,6 @@ int register_pccard_driver(dev_info_t *dev_info, ...@@ -141,9 +141,6 @@ int register_pccard_driver(dev_info_t *dev_info,
int unregister_pccard_driver(dev_info_t *dev_info); int unregister_pccard_driver(dev_info_t *dev_info);
#define register_pcmcia_driver register_pccard_driver
#define unregister_pcmcia_driver unregister_pccard_driver
extern struct bus_type pcmcia_bus_type; extern struct bus_type pcmcia_bus_type;
struct pcmcia_driver { struct pcmcia_driver {
......
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