Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304736
b: refs/heads/master
c: 1e991a1
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed May 16, 2012
1 parent 0a155e8 commit 233fb05
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 38 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: dd4f521399d059b9c42e95a42c5373e10d14c0c6
refs/heads/master: 1e991a14db758ab5050108a43651e7f86569e858
55 changes: 18 additions & 37 deletions trunk/drivers/staging/comedi/drivers/das1800.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ enum {
das1802hr, das1802hr_da, das1801hc, das1802hc, das1801ao, das1802ao
};

static int das1800_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int das1800_detach(struct comedi_device *dev);
static int das1800_probe(struct comedi_device *dev);
static int das1800_cancel(struct comedi_device *dev,
struct comedi_subdevice *s);
Expand Down Expand Up @@ -518,33 +515,6 @@ static const struct comedi_lrange range_ao_2 = {
};
*/

static struct comedi_driver driver_das1800 = {
.driver_name = "das1800",
.module = THIS_MODULE,
.attach = das1800_attach,
.detach = das1800_detach,
.num_names = ARRAY_SIZE(das1800_boards),
.board_name = &das1800_boards[0].name,
.offset = sizeof(struct das1800_board),
};

/*
* A convenient macro that defines init_module() and cleanup_module(),
* as necessary.
*/
static int __init driver_das1800_init_module(void)
{
return comedi_driver_register(&driver_das1800);
}

static void __exit driver_das1800_cleanup_module(void)
{
comedi_driver_unregister(&driver_das1800);
}

module_init(driver_das1800_init_module);
module_exit(driver_das1800_cleanup_module);

static int das1800_init_dma(struct comedi_device *dev, unsigned int dma0,
unsigned int dma1)
{
Expand Down Expand Up @@ -579,15 +549,15 @@ static int das1800_init_dma(struct comedi_device *dev, unsigned int dma0,
return -EINVAL;
break;
}
if (request_dma(dma0, driver_das1800.driver_name)) {
if (request_dma(dma0, dev->driver->driver_name)) {
dev_err(dev->hw_dev, "failed to allocate dma channel %i\n",
dma0);
return -EINVAL;
}
devpriv->dma0 = dma0;
devpriv->dma_current = dma0;
if (dma1) {
if (request_dma(dma1, driver_das1800.driver_name)) {
if (request_dma(dma1, dev->driver->driver_name)) {
dev_err(dev->hw_dev, "failed to allocate dma channel %i\n",
dma1);
return -EINVAL;
Expand Down Expand Up @@ -633,7 +603,7 @@ static int das1800_attach(struct comedi_device *dev,
return -ENOMEM;

printk(KERN_DEBUG "comedi%d: %s: io 0x%lx", dev->minor,
driver_das1800.driver_name, iobase);
dev->driver->driver_name, iobase);
if (irq) {
printk(KERN_CONT ", irq %u", irq);
if (dma0) {
Expand All @@ -650,7 +620,7 @@ static int das1800_attach(struct comedi_device *dev,
}

/* check if io addresses are available */
if (!request_region(iobase, DAS1800_SIZE, driver_das1800.driver_name)) {
if (!request_region(iobase, DAS1800_SIZE, dev->driver->driver_name)) {
printk
(" I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n",
iobase, iobase + DAS1800_SIZE - 1);
Expand All @@ -671,7 +641,7 @@ static int das1800_attach(struct comedi_device *dev,
if (thisboard->ao_ability == 2) {
iobase2 = iobase + IOBASE2;
if (!request_region(iobase2, DAS1800_SIZE,
driver_das1800.driver_name)) {
dev->driver->driver_name)) {
printk
(" I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n",
iobase2, iobase2 + DAS1800_SIZE - 1);
Expand All @@ -683,7 +653,7 @@ static int das1800_attach(struct comedi_device *dev,
/* grab our IRQ */
if (irq) {
if (request_irq(irq, das1800_interrupt, 0,
driver_das1800.driver_name, dev)) {
dev->driver->driver_name, dev)) {
dev_dbg(dev->hw_dev, "unable to allocate irq %u\n",
irq);
return -EINVAL;
Expand Down Expand Up @@ -816,7 +786,7 @@ static int das1800_detach(struct comedi_device *dev)
}

dev_dbg(dev->hw_dev, "comedi%d: %s: remove\n", dev->minor,
driver_das1800.driver_name);
dev->driver->driver_name);

return 0;
};
Expand Down Expand Up @@ -1811,6 +1781,17 @@ static unsigned int suggest_transfer_size(struct comedi_cmd *cmd)
return size;
}

static struct comedi_driver das1800_driver = {
.driver_name = "das1800",
.module = THIS_MODULE,
.attach = das1800_attach,
.detach = das1800_detach,
.num_names = ARRAY_SIZE(das1800_boards),
.board_name = &das1800_boards[0].name,
.offset = sizeof(struct das1800_board),
};
module_comedi_driver(das1800_driver);

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

0 comments on commit 233fb05

Please sign in to comment.