Commit a2d1d6ad authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Anton Blanchard

[netdrvr pcmcia] switch drivers to using pcmcia_register_driver

Affected drivers: 3c574_cs, 3c589_cs, axnet_cs, com20020_cs,
fmvj18x_cs, ibmtr_cs, nmclan_cs, smc91c92_cs, xir2ps_cs
parent b4cd547b
...@@ -1336,37 +1336,26 @@ static int el3_close(struct net_device *dev) ...@@ -1336,37 +1336,26 @@ static int el3_close(struct net_device *dev)
return 0; return 0;
} }
static int __init init_3c574_cs(void) static struct pcmcia_driver tc574_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "3c574_cs",
},
.attach = tc574_attach,
.detach = tc574_detach,
};
static int __init init_tc574(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&tc574_driver);
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "3c574_cs: Card Services release "
"does not match!\n");
return -1;
}
register_pccard_driver(&dev_info, &tc574_attach, &tc574_detach);
return 0;
} }
static void __exit exit_3c574_cs(void) static void __exit exit_tc574(void)
{ {
DEBUG(0, "3c574_cs: unloading\n"); pcmcia_unregister_driver(&tc574_driver);
unregister_pccard_driver(&dev_info);
while (dev_list != NULL) while (dev_list != NULL)
tc574_detach(dev_list); tc574_detach(dev_list);
} }
module_init(init_3c574_cs); module_init(init_tc574);
module_exit(exit_3c574_cs); module_exit(exit_tc574);
/*
* Local variables:
* compile-command: "make 3c574_cs.o"
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 4
* End:
*/
...@@ -1151,28 +1151,26 @@ static int el3_close(struct net_device *dev) ...@@ -1151,28 +1151,26 @@ static int el3_close(struct net_device *dev)
return 0; return 0;
} }
/*====================================================================*/ static struct pcmcia_driver tc589_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "3c589_cs",
},
.attach = tc589_attach,
.detach = tc589_detach,
};
static int __init init_3c589_cs(void) static int __init init_tc589(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&tc589_driver);
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_ERR "3c589_cs: Card Services release does not match!\n");
return -1;
}
register_pccard_driver(&dev_info, &tc589_attach, &tc589_detach);
return 0;
} }
static void __exit exit_3c589_cs(void) static void __exit exit_tc589(void)
{ {
DEBUG(0, "3c589_cs: unloading\n"); pcmcia_unregister_driver(&tc589_driver);
unregister_pccard_driver(&dev_info); while (dev_list != NULL)
while (dev_list != NULL) tc589_detach(dev_list);
tc589_detach(dev_list);
} }
module_init(init_3c589_cs); module_init(init_tc589);
module_exit(exit_3c589_cs); module_exit(exit_tc589);
...@@ -930,28 +930,25 @@ static void block_output(struct net_device *dev, int count, ...@@ -930,28 +930,25 @@ static void block_output(struct net_device *dev, int count,
outsw(nic_base + AXNET_DATAPORT, buf, count>>1); outsw(nic_base + AXNET_DATAPORT, buf, count>>1);
} }
/*====================================================================*/ static struct pcmcia_driver axnet_cs_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "axnet_cs",
},
.attach = axnet_attach,
.detach = axnet_detach,
};
static int __init init_axnet_cs(void) static int __init init_axnet_cs(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&axnet_cs_driver);
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "axnet_cs: Card Services release "
"does not match!\n");
return -EINVAL;
}
register_pccard_driver(&dev_info, &axnet_attach, &axnet_detach);
return 0;
} }
static void __exit exit_axnet_cs(void) static void __exit exit_axnet_cs(void)
{ {
DEBUG(0, "axnet_cs: unloading\n"); pcmcia_unregister_driver(&axnet_cs_driver);
unregister_pccard_driver(&dev_info); while (dev_list != NULL)
while (dev_list != NULL) axnet_detach(dev_list);
axnet_detach(dev_list);
} }
module_init(init_axnet_cs); module_init(init_axnet_cs);
......
...@@ -567,29 +567,26 @@ static int com20020_event(event_t event, int priority, ...@@ -567,29 +567,26 @@ static int com20020_event(event_t event, int priority,
} /* com20020_event */ } /* com20020_event */
/*====================================================================*/
static struct pcmcia_driver com20020_cs_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "com20020_cs",
},
.attach = com20020_attach,
.detach = com20020_detach,
};
static int __init init_com20020_cs(void) static int __init init_com20020_cs(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&com20020_cs_driver);
DEBUG(0, "%s\n", VERSION);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "com20020_cs: Card Services release "
"does not match!\n");
return -1;
}
register_pccard_driver(&dev_info, &com20020_attach, &com20020_detach);
return 0;
} }
static void __exit exit_com20020_cs(void) static void __exit exit_com20020_cs(void)
{ {
DEBUG(0, "com20020_cs: unloading\n"); pcmcia_unregister_driver(&com20020_cs_driver);
unregister_pccard_driver(&dev_info); while (dev_list != NULL)
while (dev_list != NULL) com20020_detach(dev_list);
com20020_detach(dev_list);
} }
module_init(init_com20020_cs); module_init(init_com20020_cs);
......
...@@ -829,28 +829,25 @@ static int fmvj18x_event(event_t event, int priority, ...@@ -829,28 +829,25 @@ static int fmvj18x_event(event_t event, int priority,
return 0; return 0;
} /* fmvj18x_event */ } /* fmvj18x_event */
/*====================================================================*/ static struct pcmcia_driver fmvj18x_cs_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "fmvj18x_cs",
},
.attach = fmvj18x_attach,
.detach = fmvj18x_detach,
};
static int __init init_fmvj18x_cs(void) static int __init init_fmvj18x_cs(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&fmvj18x_cs_driver);
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "fmvj18x: Card Services release "
"does not match!\n");
return -EINVAL;
}
register_pccard_driver(&dev_info, &fmvj18x_attach, &fmvj18x_detach);
return 0;
} }
static void __exit exit_fmvj18x_cs(void) static void __exit exit_fmvj18x_cs(void)
{ {
DEBUG(0, "fmvj18x_cs: unloading\n"); pcmcia_unregister_driver(&fmvj18x_cs_driver);
unregister_pccard_driver(&dev_info); while (dev_list != NULL)
while (dev_list != NULL) fmvj18x_detach(dev_list);
fmvj18x_detach(dev_list);
} }
module_init(init_fmvj18x_cs); module_init(init_fmvj18x_cs);
......
...@@ -585,28 +585,25 @@ static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase) ...@@ -585,28 +585,25 @@ static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase)
return; return;
} }
/*====================================================================*/ static struct pcmcia_driver ibmtr_cs_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "ibmtr_cs",
},
.attach = ibmtr_attach,
.detach = ibmtr_detach,
};
static int __init init_ibmtr_cs(void) static int __init init_ibmtr_cs(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&ibmtr_cs_driver);
DEBUG(0, "%s", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "ibmtr_cs: Card Services release "
"does not match!\n");
return -1;
}
register_pccard_driver(&dev_info, &ibmtr_attach, &ibmtr_detach);
return 0;
} }
static void __exit exit_ibmtr_cs(void) static void __exit exit_ibmtr_cs(void)
{ {
DEBUG(0, "ibmtr_cs: unloading\n"); pcmcia_unregister_driver(&ibmtr_cs_driver);
unregister_pccard_driver(&dev_info); while (dev_list != NULL)
while (dev_list != NULL) ibmtr_detach(dev_list);
ibmtr_detach(dev_list);
} }
module_init(init_ibmtr_cs); module_init(init_ibmtr_cs);
......
...@@ -1741,33 +1741,25 @@ static void set_multicast_list(struct net_device *dev) ...@@ -1741,33 +1741,25 @@ static void set_multicast_list(struct net_device *dev)
} /* set_multicast_list */ } /* set_multicast_list */
/* ---------------------------------------------------------------------------- static struct pcmcia_driver nmclan_cs_driver = {
init_nmclan_cs .owner = THIS_MODULE,
---------------------------------------------------------------------------- */ .drv = {
.name = "nmclan_cs",
},
.attach = nmclan_attach,
.detach = nmclan_detach,
};
static int __init init_nmclan_cs(void) static int __init init_nmclan_cs(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&nmclan_cs_driver);
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_NOTICE "nmclan_cs: Card Services release does not match!\n");
return -1;
}
register_pccard_driver(&dev_info, &nmclan_attach, &nmclan_detach);
return 0;
} }
/* ----------------------------------------------------------------------------
exit_nmclan_cs
---------------------------------------------------------------------------- */
static void __exit exit_nmclan_cs(void) static void __exit exit_nmclan_cs(void)
{ {
DEBUG(0, "nmclan_cs: unloading\n"); pcmcia_unregister_driver(&nmclan_cs_driver);
unregister_pccard_driver(&dev_info); while (dev_list != NULL)
while (dev_list != NULL) nmclan_detach(dev_list);
nmclan_detach(dev_list);
} }
module_init(init_nmclan_cs); module_init(init_nmclan_cs);
......
...@@ -2265,29 +2265,25 @@ static int smc_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2265,29 +2265,25 @@ static int smc_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
return rc; return rc;
} }
static struct pcmcia_driver smc91c92_cs_driver = {
/*====================================================================*/ .owner = THIS_MODULE,
.drv = {
.name = "smc91c92_cs",
},
.attach = smc91c92_attach,
.detach = smc91c92_detach,
};
static int __init init_smc91c92_cs(void) static int __init init_smc91c92_cs(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&smc91c92_cs_driver);
DEBUG(0, "%s\n", version);
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KERN_ERR
"smc91c92_cs: Card Services release does not match!\n");
return -EINVAL;
}
register_pccard_driver(&dev_info, &smc91c92_attach, &smc91c92_detach);
return 0;
} }
static void __exit exit_smc91c92_cs(void) static void __exit exit_smc91c92_cs(void)
{ {
DEBUG(0, "smc91c92_cs: unloading\n"); pcmcia_unregister_driver(&smc91c92_cs_driver);
unregister_pccard_driver(&dev_info); while (dev_list != NULL)
while (dev_list != NULL) smc91c92_detach(dev_list);
smc91c92_detach(dev_list);
} }
module_init(init_smc91c92_cs); module_init(init_smc91c92_cs);
......
...@@ -2069,35 +2069,32 @@ do_stop(struct net_device *dev) ...@@ -2069,35 +2069,32 @@ do_stop(struct net_device *dev)
return 0; return 0;
} }
static struct pcmcia_driver xirc2ps_cs_driver = {
.owner = THIS_MODULE,
.drv = {
.name = "xirc2ps_cs",
},
.attach = xirc2ps_attach,
.detach = xirc2ps_detach,
};
static int __init static int __init
init_xirc2ps_cs(void) init_xirc2ps_cs(void)
{ {
servinfo_t serv; return pcmcia_register_driver(&xirc2ps_cs_driver);
printk(KERN_INFO "%s\n", version);
if (lockup_hack)
printk(KINF_XIRC "lockup hack is enabled\n");
CardServices(GetCardServicesInfo, &serv);
if (serv.Revision != CS_RELEASE_CODE) {
printk(KNOT_XIRC "Card Services release does not match!\n");
return -1;
}
DEBUG(0, "pc_debug=%d\n", pc_debug);
register_pccard_driver(&dev_info, &xirc2ps_attach, &xirc2ps_detach);
return 0;
} }
static void __exit static void __exit
exit_xirc2ps_cs(void) exit_xirc2ps_cs(void)
{ {
DEBUG(0, "unloading\n"); pcmcia_unregister_driver(&xirc2ps_cs_driver);
unregister_pccard_driver(&dev_info);
while (dev_list) { while (dev_list) {
if (dev_list->state & DEV_CONFIG) if (dev_list->state & DEV_CONFIG)
xirc2ps_release((u_long)dev_list); xirc2ps_release((u_long)dev_list);
if (dev_list) /* xirc2ps_release() might already have detached... */ if (dev_list) /* xirc2ps_release() might already have detached... */
xirc2ps_detach(dev_list); xirc2ps_detach(dev_list);
} }
} }
module_init(init_xirc2ps_cs); module_init(init_xirc2ps_cs);
......
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