Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304717
b: refs/heads/master
c: 48b992b
h: refs/heads/master
i:
  304715: 33b2d2d
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed May 16, 2012
1 parent 75c03fd commit 3007cdd
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 72 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: ecdc3e0d12c3c94abc9e3d7903ea55e7c1f350bb
refs/heads/master: 48b992b49f56f03a425a42c6d7fefe72c8d5648e
109 changes: 38 additions & 71 deletions trunk/drivers/staging/comedi/drivers/cb_pcimdda.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,6 @@ static const struct board_struct boards[] = {
#define REG_SZ (thisboard->reg_sz)
#define REGS_BADRINDEX (thisboard->regs_badrindex)

/* This is used by modprobe to translate PCI IDs to drivers. Should
* only be used for PCI and ISA-PnP devices */
/* Please add your PCI vendor ID to comedidev.h, and it will be forwarded
* upstream. */
static DEFINE_PCI_DEVICE_TABLE(pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_COMPUTERBOARDS, PCI_ID_PCIM_DDA06_16) },
{0}
};

MODULE_DEVICE_TABLE(pci, pci_table);

/*
* this structure is for data unique to this hardware driver. If
* several hardware drivers keep similar information in this structure,
Expand All @@ -177,66 +166,6 @@ struct board_private_struct {
*/
#define devpriv ((struct board_private_struct *)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 attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int detach(struct comedi_device *dev);
static struct comedi_driver cb_pcimdda_driver = {
.driver_name = "cb_pcimdda",
.module = THIS_MODULE,
.attach = attach,
.detach = detach,
};

MODULE_AUTHOR("Calin A. Culianu <calin@rtlab.org>");
MODULE_DESCRIPTION("Comedi low-level driver for the Computerboards PCIM-DDA "
"series. Currently only supports PCIM-DDA06-16 (which "
"also happens to be the only board in this series. :) ) ");
MODULE_LICENSE("GPL");
static int __devinit cb_pcimdda_driver_pci_probe(struct pci_dev *dev,
const struct pci_device_id
*ent)
{
return comedi_pci_auto_config(dev, &cb_pcimdda_driver);
}

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

static struct pci_driver cb_pcimdda_driver_pci_driver = {
.id_table = pci_table,
.probe = &cb_pcimdda_driver_pci_probe,
.remove = __devexit_p(&cb_pcimdda_driver_pci_remove)
};

static int __init cb_pcimdda_driver_init_module(void)
{
int retval;

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

cb_pcimdda_driver_pci_driver.name =
(char *)cb_pcimdda_driver.driver_name;
return pci_register_driver(&cb_pcimdda_driver_pci_driver);
}

static void __exit cb_pcimdda_driver_cleanup_module(void)
{
pci_unregister_driver(&cb_pcimdda_driver_pci_driver);
comedi_driver_unregister(&cb_pcimdda_driver);
}

module_init(cb_pcimdda_driver_init_module);
module_exit(cb_pcimdda_driver_cleanup_module);

static int ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
Expand Down Expand Up @@ -515,3 +444,41 @@ static int probe(struct comedi_device *dev, const struct comedi_devconfig *it)
"card found at the requested position\n");
return -ENODEV;
}

static struct comedi_driver cb_pcimdda_driver = {
.driver_name = "cb_pcimdda",
.module = THIS_MODULE,
.attach = attach,
.detach = detach,
};

static int __devinit cb_pcimdda_pci_probe(struct pci_dev *dev,
const struct pci_device_id *ent)
{
return comedi_pci_auto_config(dev, &cb_pcimdda_driver);
}

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

static DEFINE_PCI_DEVICE_TABLE(cb_pcimdda_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_COMPUTERBOARDS, PCI_ID_PCIM_DDA06_16) },
{ 0 }
};
MODULE_DEVICE_TABLE(pci, cb_pcimdda_pci_table);

static struct pci_driver cb_pcimdda_driver_pci_driver = {
.name = "cb_pcimdda",
.id_table = cb_pcimdda_pci_table,
.probe = cb_pcimdda_pci_probe,
.remove = __devexit_p(cb_pcimdda_pci_remove),
};
module_comedi_pci_driver(cb_pcimdda_driver, cb_pcimdda_driver_pci_driver);

MODULE_AUTHOR("Calin A. Culianu <calin@rtlab.org>");
MODULE_DESCRIPTION("Comedi low-level driver for the Computerboards PCIM-DDA "
"series. Currently only supports PCIM-DDA06-16 (which "
"also happens to be the only board in this series. :) ) ");
MODULE_LICENSE("GPL");

0 comments on commit 3007cdd

Please sign in to comment.