Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304718
b: refs/heads/master
c: 0835145
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed May 16, 2012
1 parent 3007cdd commit a20f700
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 60 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 48b992b49f56f03a425a42c6d7fefe72c8d5648e
refs/heads/master: 0835145d54fee8464bd14fb4dc907f5b6628649c
81 changes: 22 additions & 59 deletions trunk/drivers/staging/comedi/drivers/cb_pcimdas.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,6 @@ static const struct cb_pcimdas_board cb_pcimdas_boards[] = {
},
};

/* This is used by modprobe to translate PCI IDs to drivers. Should
* only be used for PCI and ISA-PnP devices */
static DEFINE_PCI_DEVICE_TABLE(cb_pcimdas_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_COMPUTERBOARDS, 0x0056) },
{ 0 }
};

MODULE_DEVICE_TABLE(pci, cb_pcimdas_pci_table);

#define N_BOARDS 1 /* Max number of boards supported */

/*
Expand Down Expand Up @@ -175,22 +166,6 @@ struct cb_pcimdas_private {
*/
#define devpriv ((struct cb_pcimdas_private *)dev->private)

/*
* The struct comedi_driver structure tells the Comedi core module
* which functions to call to configure/deconfigure (attach/detach)
* the board, and also about the kernel module that contains
* the device code.
*/
static int cb_pcimdas_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int cb_pcimdas_detach(struct comedi_device *dev);
static struct comedi_driver driver_cb_pcimdas = {
.driver_name = "cb_pcimdas",
.module = THIS_MODULE,
.attach = cb_pcimdas_attach,
.detach = cb_pcimdas_detach,
};

static int cb_pcimdas_ai_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
Expand Down Expand Up @@ -486,49 +461,37 @@ static int cb_pcimdas_ao_rinsn(struct comedi_device *dev,
return i;
}

/*
* A convenient macro that defines init_module() and cleanup_module(),
* as necessary.
*/
static int __devinit driver_cb_pcimdas_pci_probe(struct pci_dev *dev,
const struct pci_device_id
*ent)
static struct comedi_driver cb_pcimdas_driver = {
.driver_name = "cb_pcimdas",
.module = THIS_MODULE,
.attach = cb_pcimdas_attach,
.detach = cb_pcimdas_detach,
};

static int __devinit cb_pcimdas_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
{
return comedi_pci_auto_config(dev, &driver_cb_pcimdas);
return comedi_pci_auto_config(dev, &cb_pcimdas_driver);
}

static void __devexit driver_cb_pcimdas_pci_remove(struct pci_dev *dev)
static void __devexit cb_pcimdas_pci_remove(struct pci_dev *dev)
{
comedi_pci_auto_unconfig(dev);
}

static struct pci_driver driver_cb_pcimdas_pci_driver = {
.id_table = cb_pcimdas_pci_table,
.probe = &driver_cb_pcimdas_pci_probe,
.remove = __devexit_p(&driver_cb_pcimdas_pci_remove)
static DEFINE_PCI_DEVICE_TABLE(cb_pcimdas_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_COMPUTERBOARDS, 0x0056) },
{ 0 }
};
MODULE_DEVICE_TABLE(pci, cb_pcimdas_pci_table);

static int __init driver_cb_pcimdas_init_module(void)
{
int retval;

retval = comedi_driver_register(&driver_cb_pcimdas);
if (retval < 0)
return retval;

driver_cb_pcimdas_pci_driver.name =
(char *)driver_cb_pcimdas.driver_name;
return pci_register_driver(&driver_cb_pcimdas_pci_driver);
}

static void __exit driver_cb_pcimdas_cleanup_module(void)
{
pci_unregister_driver(&driver_cb_pcimdas_pci_driver);
comedi_driver_unregister(&driver_cb_pcimdas);
}

module_init(driver_cb_pcimdas_init_module);
module_exit(driver_cb_pcimdas_cleanup_module);
static struct pci_driver cb_pcimdas_pci_driver = {
.name = "cb_pcimdas",
.id_table = cb_pcimdas_pci_table,
.probe = cb_pcimdas_pci_probe,
.remove = __devexit_p(cb_pcimdas_pci_remove),
};
module_comedi_pci_driver(cb_pcimdas_driver, cb_pcimdas_pci_driver);

MODULE_AUTHOR("Comedi http://www.comedi.org");
MODULE_DESCRIPTION("Comedi low-level driver");
Expand Down

0 comments on commit a20f700

Please sign in to comment.