Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304723
b: refs/heads/master
c: c576306
h: refs/heads/master
i:
  304721: 62c31c2
  304719: 29df0ba
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed May 16, 2012
1 parent 45c11f3 commit 56c481b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 67 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: bdc7cc500aee9b29117a1249e6ad709c75223222
refs/heads/master: c57630673b84a2e0563ea63117062b1ab51f4bbf
102 changes: 36 additions & 66 deletions trunk/drivers/staging/comedi/drivers/amplc_pci230.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,6 @@ static const struct pci230_board pci230_boards[] = {
},
};

static DEFINE_PCI_DEVICE_TABLE(pci230_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_PCI230) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_PCI260) },
{0}
};

MODULE_DEVICE_TABLE(pci, pci230_pci_table);
/*
* Useful for shorthand access to the particular board structure
*/
Expand Down Expand Up @@ -595,65 +588,6 @@ static const struct comedi_lrange pci230_ao_range = { 2, {
/* PCI230 daccon bipolar flag for each analogue output range. */
static const unsigned char pci230_ao_bipolar[2] = { 0, 1 };

/*
* 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 pci230_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int pci230_detach(struct comedi_device *dev);
static struct comedi_driver driver_amplc_pci230 = {
.driver_name = "amplc_pci230",
.module = THIS_MODULE,
.attach = pci230_attach,
.detach = pci230_detach,
.board_name = &pci230_boards[0].name,
.offset = sizeof(pci230_boards[0]),
.num_names = ARRAY_SIZE(pci230_boards),
};

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

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

static struct pci_driver driver_amplc_pci230_pci_driver = {
.id_table = pci230_pci_table,
.probe = &driver_amplc_pci230_pci_probe,
.remove = __devexit_p(&driver_amplc_pci230_pci_remove)
};

static int __init driver_amplc_pci230_init_module(void)
{
int retval;

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

driver_amplc_pci230_pci_driver.name =
(char *)driver_amplc_pci230.driver_name;
return pci_register_driver(&driver_amplc_pci230_pci_driver);
}

static void __exit driver_amplc_pci230_cleanup_module(void)
{
pci_unregister_driver(&driver_amplc_pci230_pci_driver);
comedi_driver_unregister(&driver_amplc_pci230);
}

module_init(driver_amplc_pci230_init_module);
module_exit(driver_amplc_pci230_cleanup_module);

static int pci230_ai_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn,
unsigned int *data);
Expand Down Expand Up @@ -3048,6 +2982,42 @@ static int pci230_ai_cancel(struct comedi_device *dev,
return 0;
}

static struct comedi_driver amplc_pci230_driver = {
.driver_name = "amplc_pci230",
.module = THIS_MODULE,
.attach = pci230_attach,
.detach = pci230_detach,
.board_name = &pci230_boards[0].name,
.offset = sizeof(pci230_boards[0]),
.num_names = ARRAY_SIZE(pci230_boards),
};

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

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

static DEFINE_PCI_DEVICE_TABLE(amplc_pci230_pci_table) = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_PCI230) },
{ PCI_DEVICE(PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_PCI260) },
{ 0 }
};
MODULE_DEVICE_TABLE(pci, amplc_pci230_pci_table);

static struct pci_driver amplc_pci230_pci_driver = {
.name = "amplc_pci230",
.id_table = amplc_pci230_pci_table,
.probe = amplc_pci230_pci_probe,
.remove = __devexit_p(amplc_pci230_pci_remove)
};
module_comedi_pci_driver(amplc_pci230_driver, amplc_pci230_pci_driver);

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

0 comments on commit 56c481b

Please sign in to comment.