Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304712
b: refs/heads/master
c: 71e7271
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed May 16, 2012
1 parent bac22fc commit 3eb9fff
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 45 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: b1a4fe985fb2cd4dc381fd501286ee88ffd7184f
refs/heads/master: 71e7271b15d55d8ab668745f680d03044bcf7db0
70 changes: 26 additions & 44 deletions trunk/drivers/staging/comedi/drivers/das6402.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,29 +99,6 @@ This driver has suffered bitrot.
#define C2 0x80
#define RWLH 0x30

static int das6402_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int das6402_detach(struct comedi_device *dev);
static struct comedi_driver driver_das6402 = {
.driver_name = "das6402",
.module = THIS_MODULE,
.attach = das6402_attach,
.detach = das6402_detach,
};

static int __init driver_das6402_init_module(void)
{
return comedi_driver_register(&driver_das6402);
}

static void __exit driver_das6402_cleanup_module(void)
{
comedi_driver_unregister(&driver_das6402);
}

module_init(driver_das6402_init_module);
module_exit(driver_das6402_cleanup_module);

struct das6402_private {
int ai_bytes_to_read;

Expand All @@ -130,7 +107,14 @@ struct das6402_private {
#define devpriv ((struct das6402_private *)dev->private)

static void das6402_ai_fifo_dregs(struct comedi_device *dev,
struct comedi_subdevice *s);
struct comedi_subdevice *s)
{
while (1) {
if (!(inb(dev->iobase + 8) & 0x01))
return;
comedi_buf_put(s->async, inw(dev->iobase));
}
}

static void das6402_setcounter(struct comedi_device *dev)
{
Expand Down Expand Up @@ -209,16 +193,6 @@ static void das6402_ai_fifo_read(struct comedi_device *dev, short *data, int n)
}
#endif

static void das6402_ai_fifo_dregs(struct comedi_device *dev,
struct comedi_subdevice *s)
{
while (1) {
if (!(inb(dev->iobase + 8) & 0x01))
return;
comedi_buf_put(s->async, inw(dev->iobase));
}
}

static int das6402_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
Expand Down Expand Up @@ -300,16 +274,6 @@ static int board_init(struct comedi_device *dev)
return 0;
}

static int das6402_detach(struct comedi_device *dev)
{
if (dev->irq)
free_irq(dev->irq, dev);
if (dev->iobase)
release_region(dev->iobase, DAS6402_SIZE);

return 0;
}

static int das6402_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
Expand Down Expand Up @@ -363,6 +327,24 @@ static int das6402_attach(struct comedi_device *dev,
return 0;
}

static int das6402_detach(struct comedi_device *dev)
{
if (dev->irq)
free_irq(dev->irq, dev);
if (dev->iobase)
release_region(dev->iobase, DAS6402_SIZE);

return 0;
}

static struct comedi_driver das6402_driver = {
.driver_name = "das6402",
.module = THIS_MODULE,
.attach = das6402_attach,
.detach = das6402_detach,
};
module_comedi_driver(das6402_driver)

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

0 comments on commit 3eb9fff

Please sign in to comment.