Commit db0eaeed authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: refactor adl_pci7296 driver to remove forward declarations

Move the struct comedi_driver variable and the associated
attach/detach routines to remove the need for the forward
declarations.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Mori Hess <fmhess@users.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d7bd1cd1
...@@ -48,13 +48,6 @@ Configuration Options: ...@@ -48,13 +48,6 @@ Configuration Options:
#define PCI_DEVICE_ID_PCI7296 0x7296 #define PCI_DEVICE_ID_PCI7296 0x7296
static DEFINE_PCI_DEVICE_TABLE(adl_pci7296_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7296) },
{0}
};
MODULE_DEVICE_TABLE(pci, adl_pci7296_pci_table);
struct adl_pci7296_private { struct adl_pci7296_private {
int data; int data;
struct pci_dev *pci_dev; struct pci_dev *pci_dev;
...@@ -62,16 +55,6 @@ struct adl_pci7296_private { ...@@ -62,16 +55,6 @@ struct adl_pci7296_private {
#define devpriv ((struct adl_pci7296_private *)dev->private) #define devpriv ((struct adl_pci7296_private *)dev->private)
static int adl_pci7296_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int adl_pci7296_detach(struct comedi_device *dev);
static struct comedi_driver driver_adl_pci7296 = {
.driver_name = "adl_pci7296",
.module = THIS_MODULE,
.attach = adl_pci7296_attach,
.detach = adl_pci7296_detach,
};
static int adl_pci7296_attach(struct comedi_device *dev, static int adl_pci7296_attach(struct comedi_device *dev,
struct comedi_devconfig *it) struct comedi_devconfig *it)
{ {
...@@ -172,6 +155,13 @@ static int adl_pci7296_detach(struct comedi_device *dev) ...@@ -172,6 +155,13 @@ static int adl_pci7296_detach(struct comedi_device *dev)
return 0; return 0;
} }
static struct comedi_driver driver_adl_pci7296 = {
.driver_name = "adl_pci7296",
.module = THIS_MODULE,
.attach = adl_pci7296_attach,
.detach = adl_pci7296_detach,
};
static int __devinit driver_adl_pci7296_pci_probe(struct pci_dev *dev, static int __devinit driver_adl_pci7296_pci_probe(struct pci_dev *dev,
const struct pci_device_id const struct pci_device_id
*ent) *ent)
...@@ -184,10 +174,16 @@ static void __devexit driver_adl_pci7296_pci_remove(struct pci_dev *dev) ...@@ -184,10 +174,16 @@ static void __devexit driver_adl_pci7296_pci_remove(struct pci_dev *dev)
comedi_pci_auto_unconfig(dev); comedi_pci_auto_unconfig(dev);
} }
static DEFINE_PCI_DEVICE_TABLE(adl_pci7296_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7296) },
{0}
};
MODULE_DEVICE_TABLE(pci, adl_pci7296_pci_table);
static struct pci_driver driver_adl_pci7296_pci_driver = { static struct pci_driver driver_adl_pci7296_pci_driver = {
.id_table = adl_pci7296_pci_table, .id_table = adl_pci7296_pci_table,
.probe = &driver_adl_pci7296_pci_probe, .probe = driver_adl_pci7296_pci_probe,
.remove = __devexit_p(&driver_adl_pci7296_pci_remove) .remove = __devexit_p(driver_adl_pci7296_pci_remove)
}; };
static int __init driver_adl_pci7296_init_module(void) static int __init driver_adl_pci7296_init_module(void)
...@@ -202,14 +198,13 @@ static int __init driver_adl_pci7296_init_module(void) ...@@ -202,14 +198,13 @@ static int __init driver_adl_pci7296_init_module(void)
(char *)driver_adl_pci7296.driver_name; (char *)driver_adl_pci7296.driver_name;
return pci_register_driver(&driver_adl_pci7296_pci_driver); return pci_register_driver(&driver_adl_pci7296_pci_driver);
} }
module_init(driver_adl_pci7296_init_module);
static void __exit driver_adl_pci7296_cleanup_module(void) static void __exit driver_adl_pci7296_cleanup_module(void)
{ {
pci_unregister_driver(&driver_adl_pci7296_pci_driver); pci_unregister_driver(&driver_adl_pci7296_pci_driver);
comedi_driver_unregister(&driver_adl_pci7296); comedi_driver_unregister(&driver_adl_pci7296);
} }
module_init(driver_adl_pci7296_init_module);
module_exit(driver_adl_pci7296_cleanup_module); module_exit(driver_adl_pci7296_cleanup_module);
MODULE_AUTHOR("Comedi http://www.comedi.org"); MODULE_AUTHOR("Comedi http://www.comedi.org");
......
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