Commit cca66bf2 authored by Russell King's avatar Russell King

Merge flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5

into flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5-pcmcia
parents 015498d5 a22fcf63
......@@ -3131,9 +3131,18 @@ void mgslpc_remove_device(MGSLPC_INFO *remove_info)
}
}
static struct pcmcia_driver mgslpc_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "synclink_cs",
},
.attach = mgslpc_attach,
.detach = mgslpc_detach,
};
static int __init synclink_cs_init(void)
{
servinfo_t serv;
int error;
if (break_on_load) {
mgslpc_get_text_ptr();
......@@ -3142,13 +3151,9 @@ static int __init synclink_cs_init(void)
printk("%s %s\n", driver_name, driver_version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "synclink_cs: Card Services release "
"does not match!\n");
return -1;
}
register_pccard_driver(&dev_info, &mgslpc_attach, &mgslpc_detach);
error = pcmcia_register_driver(&mgslpc_driver);
if (error)
return error;
/* Initialize the tty_driver structure */
......@@ -3217,7 +3222,9 @@ static void __exit synclink_cs_exit(void)
printk("%s(%d) failed to unregister tty driver err=%d\n",
__FILE__,__LINE__,rc);
unregister_pccard_driver(&dev_info);
pcmcia_unregister_driver(&mgslpc_driver);
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG)
mgslpc_release((u_long)dev_list);
......
......@@ -470,28 +470,25 @@ int ide_event(event_t event, int priority,
return 0;
} /* ide_event */
/*====================================================================*/
static struct pcmcia_driver ide_cs_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "ide_cs",
},
.attach = ide_attach,
.detach = ide_detach,
};
static int __init init_ide_cs(void)
{
servinfo_t serv;
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "ide-cs: Card Services release "
"does not match!\n");
return -EINVAL;
}
register_pccard_driver(&dev_info, &ide_attach, &ide_detach);
return 0;
return pcmcia_register_driver(&ide_cs_driver);
}
static void __exit exit_ide_cs(void)
{
DEBUG(0, "ide-cs: unloading\n");
unregister_pccard_driver(&dev_info);
while (dev_list != NULL)
ide_detach(dev_list);
pcmcia_unregister_driver(&ide_cs_driver);
while (dev_list != NULL)
ide_detach(dev_list);
}
module_init(init_ide_cs);
......
......@@ -510,29 +510,30 @@ static int avmcs_event(event_t event, int priority,
return 0;
} /* avmcs_event */
/*====================================================================*/
static struct pcmcia_driver avmcs_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "avmcs_cs",
},
.attach = avmcs_attach,
.detach = avmcs_detach,
};
static int __init avmcs_init(void)
{
servinfo_t serv;
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "avm_cs: Card Services release "
"does not match!\n");
return -1;
}
register_pccard_driver(&dev_info, &avmcs_attach, &avmcs_detach);
return 0;
return pcmcia_register_driver(&avmcs_driver);
}
static void __exit avmcs_exit(void)
{
unregister_pccard_driver(&dev_info);
while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG)
avmcs_release((u_long)dev_list);
avmcs_detach(dev_list);
}
pcmcia_unregister_driver(&avmcs_driver);
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG)
avmcs_release((u_long)dev_list);
avmcs_detach(dev_list);
}
}
module_init(avmcs_init);
......
......@@ -515,30 +515,30 @@ static int avma1cs_event(event_t event, int priority,
return 0;
} /* avma1cs_event */
/*====================================================================*/
static struct pcmcia_driver avma1cs_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "avma1_cs",
},
.attach = avma1cs_attach,
.detach = avma1cs_detach,
};
static int __init init_avma1_cs(void)
{
servinfo_t serv;
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "avma1_cs: Card Services release "
"does not match!\n");
return -1;
}
register_pccard_driver(&dev_info, &avma1cs_attach, &avma1cs_detach);
return 0;
return pcmcia_register_driver(&avma1cs_driver);
}
static void __exit exit_avma1_cs(void)
{
DEBUG(0, "avma1_cs: unloading\n");
unregister_pccard_driver(&dev_info);
while (dev_list != NULL)
if (dev_list->state & DEV_CONFIG)
avma1cs_release((u_long)dev_list);
avma1cs_detach(dev_list);
pcmcia_unregister_driver(&avma1cs_driver);
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG)
avma1cs_release((u_long)dev_list);
avma1cs_detach(dev_list);
}
}
module_init(init_avma1_cs);
......
......@@ -531,28 +531,27 @@ static int elsa_cs_event(event_t event, int priority,
return 0;
} /* elsa_cs_event */
/*====================================================================*/
static struct pcmcia_driver elsa_cs_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "elsa_cs",
},
.attach = elsa_cs_attach,
.detach = elsa_cs_detach,
};
static int __init init_elsa_cs(void)
{
servinfo_t serv;
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "elsa_cs: Card Services release "
"does not match!\n");
return -1;
}
register_pccard_driver(&dev_info, &elsa_cs_attach, &elsa_cs_detach);
return 0;
return pcmcia_register_driver(&elsa_cs_driver);
}
static void __exit exit_elsa_cs(void)
{
DEBUG(0, "elsa_cs: unloading\n");
unregister_pccard_driver(&dev_info);
while (dev_list != NULL)
elsa_cs_detach(dev_list);
pcmcia_unregister_driver(&elsa_cs_driver);
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL)
elsa_cs_detach(dev_list);
}
module_init(init_elsa_cs);
......
......@@ -633,34 +633,32 @@ static int sedlbauer_event(event_t event, int priority,
return 0;
} /* sedlbauer_event */
/*====================================================================*/
static struct pcmcia_driver sedlbauer_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "sedlbauer_cs",
},
.attach = sedlbauer_attach,
.detach = sedlbauer_detach,
};
static int __init init_sedlbauer_cs(void)
{
servinfo_t serv;
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "sedlbauer_cs: Card Services release "
"does not match!\n");
return -1;
}
register_pccard_driver(&dev_info, &sedlbauer_attach, &sedlbauer_detach);
return 0;
return pcmcia_register_driver(&sedlbauer_driver);
}
static void __exit exit_sedlbauer_cs(void)
{
DEBUG(0, "sedlbauer_cs: unloading\n");
unregister_pccard_driver(&dev_info);
while (dev_list != NULL) {
del_timer(&dev_list->release);
if (dev_list->state & DEV_CONFIG)
sedlbauer_release((u_long)dev_list);
sedlbauer_detach(dev_list);
}
pcmcia_unregister_driver(&sedlbauer_driver);
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL) {
del_timer(&dev_list->release);
if (dev_list->state & DEV_CONFIG)
sedlbauer_release((u_long)dev_list);
sedlbauer_detach(dev_list);
}
}
module_init(init_sedlbauer_cs);
module_exit(exit_sedlbauer_cs);
......@@ -836,17 +836,18 @@ static dev_link_t *pcmciamtd_attach(void)
return link;
}
static struct pcmcia_driver pcmciamtd_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "pcmciamtd",
},
.attach = pcmciamtd_attach,
.detach = pcmciamtd_detach,
};
static int __init init_pcmciamtd(void)
{
servinfo_t serv;
info(DRIVER_DESC " " DRIVER_VERSION);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
err("Card Services release does not match!");
return -1;
}
if(buswidth && buswidth != 1 && buswidth != 2) {
info("bad buswidth (%d), using default", buswidth);
......@@ -860,8 +861,8 @@ static int __init init_pcmciamtd(void)
info("bad mem_type (%d), using default", mem_type);
mem_type = 0;
}
register_pccard_driver(&dev_info, &pcmciamtd_attach, &pcmciamtd_detach);
return 0;
return pcmcia_register_driver(&pcmciamtd_driver);
}
......@@ -870,7 +871,10 @@ static void __exit exit_pcmciamtd(void)
struct list_head *temp1, *temp2;
DEBUG(1, DRIVER_DESC " unloading");
unregister_pccard_driver(&dev_info);
pcmcia_unregister_driver(&pcmciamtd_driver);
/* XXX: this really needs to move into generic code.. */
list_for_each_safe(temp1, temp2, &dev_list) {
dev_link_t *link = &list_entry(temp1, struct pcmciamtd_dev, list)->link;
if (link && (link->state & DEV_CONFIG)) {
......
......@@ -1620,16 +1620,7 @@ static struct pcmcia_driver pcnet_driver = {
static int __init init_pcnet_cs(void)
{
servinfo_t serv;
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "pcnet_cs: Card Services release "
"does not match!\n");
return -EINVAL;
}
pcmcia_register_driver(&pcnet_driver);
return 0;
return pcmcia_register_driver(&pcnet_driver);
}
static void __exit exit_pcnet_cs(void)
......
......@@ -390,28 +390,27 @@ int parport_event(event_t event, int priority,
return 0;
} /* parport_event */
/*====================================================================*/
static struct pcmcia_driver parport_cs_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "parport_cs",
},
.attach = parport_attach,
.detach = parport_detach,
};
static int __init init_parport_cs(void)
{
servinfo_t serv;
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "parport_cs: Card Services release "
"does not match!\n");
return -EINVAL;
}
register_pccard_driver(&dev_info, &parport_attach, &parport_detach);
return 0;
return pcmcia_register_driver(&parport_cs_driver);
}
static void __exit exit_parport_cs(void)
{
DEBUG(0, "parport_cs: unloading\n");
unregister_pccard_driver(&dev_info);
while (dev_list != NULL)
parport_detach(dev_list);
pcmcia_unregister_driver(&parport_cs_driver);
/* XXX: this really needs to move into generic code.. */
while (dev_list != NULL)
parport_detach(dev_list);
}
module_init(init_parport_cs);
......
......@@ -182,50 +182,6 @@ void pcmcia_unregister_driver(struct pcmcia_driver *driver)
}
EXPORT_SYMBOL(pcmcia_unregister_driver);
int register_pccard_driver(dev_info_t *dev_info,
dev_link_t *(*attach)(void),
void (*detach)(dev_link_t *))
{
struct pcmcia_driver *driver;
DEBUG(0, "ds: register_pccard_driver('%s')\n", (char *)dev_info);
driver = get_pcmcia_driver(dev_info);
if (driver)
return -EBUSY;
driver = kmalloc(sizeof(struct pcmcia_driver), GFP_KERNEL);
if (!driver) return -ENOMEM;
memset(driver, 0, sizeof(struct pcmcia_driver));
driver->drv.name = (char *)dev_info;
pcmcia_register_driver(driver);
driver->attach = attach;
driver->detach = detach;
return 0;
} /* register_pccard_driver */
/*====================================================================*/
int unregister_pccard_driver(dev_info_t *dev_info)
{
struct pcmcia_driver *driver;
DEBUG(0, "ds: unregister_pccard_driver('%s')\n",
(char *)dev_info);
driver = get_pcmcia_driver(dev_info);
if (!driver)
return -ENODEV;
pcmcia_unregister_driver(driver);
kfree(driver);
return 0;
} /* unregister_pccard_driver */
/*====================================================================*/
#ifdef CONFIG_PROC_FS
static int proc_read_drivers_callback(struct device_driver *driver, void *d)
{
......@@ -876,11 +832,6 @@ static struct file_operations ds_fops = {
.poll = ds_poll,
};
EXPORT_SYMBOL(register_pccard_driver);
EXPORT_SYMBOL(unregister_pccard_driver);
/*====================================================================*/
static int __devinit pcmcia_bus_add_socket(struct device *dev, unsigned int socket_nr)
{
client_reg_t client_reg;
......
......@@ -196,9 +196,9 @@ static void __devexit cardbus_remove (struct pci_dev *dev)
pci_socket_t *socket = pci_get_drvdata(dev);
/* note: we are already unregistered from the cs core */
class_device_unregister(&socket->cls_d.class_dev);
if (socket->op && socket->op->close)
socket->op->close(socket);
class_device_unregister(&socket->cls_d.class_dev);
pci_set_drvdata(dev, NULL);
}
......
......@@ -156,12 +156,6 @@ struct pcmcia_driver {
int pcmcia_register_driver(struct pcmcia_driver *driver);
void pcmcia_unregister_driver(struct pcmcia_driver *driver);
/* legacy driver registration interface. don't use in new code */
int register_pccard_driver(dev_info_t *dev_info,
dev_link_t *(*attach)(void),
void (*detach)(dev_link_t *));
int unregister_pccard_driver(dev_info_t *dev_info);
/* error reporting */
void cs_error(client_handle_t handle, int func, int ret);
......
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