Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364156
b: refs/heads/master
c: a0b4bcc
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 19, 2013
1 parent e97c224 commit 93bc583
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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: adfaa207ca4140fe6a09550549308248e651e2b9
refs/heads/master: a0b4bccc40983535f518f87792bcb9a7eb103a79
20 changes: 10 additions & 10 deletions trunk/drivers/staging/comedi/drivers/das16m1.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ struct das16m1_private_struct {
unsigned int do_bits; /* saves status of digital output bits */
unsigned int divisor1; /* divides master clock to obtain conversion speed */
unsigned int divisor2; /* divides master clock to obtain conversion speed */
unsigned long extra_iobase;
};

static inline short munge_sample(short data)
Expand Down Expand Up @@ -583,11 +584,9 @@ static int das16m1_attach(struct comedi_device *dev,
/* Request an additional region for the 8255 */
ret = __comedi_request_region(dev, dev->iobase + DAS16M1_82C55,
DAS16M1_SIZE2);
if (ret) {
release_region(dev->iobase, DAS16M1_SIZE);
dev->iobase = 0;
return -EIO;
}
if (ret)
return ret;
devpriv->extra_iobase = dev->iobase + DAS16M1_82C55;

/* now for the irq */
irq = it->options[1];
Expand Down Expand Up @@ -649,7 +648,7 @@ static int das16m1_attach(struct comedi_device *dev,

s = &dev->subdevices[3];
/* 8255 */
subdev_8255_init(dev, s, NULL, dev->iobase + DAS16M1_82C55);
subdev_8255_init(dev, s, NULL, devpriv->extra_iobase);

/* disable upper half of hardware conversion counter so it doesn't mess with us */
outb(TOTAL_CLEAR, dev->iobase + DAS16M1_8254_FIRST_CNTRL);
Expand All @@ -669,13 +668,14 @@ static int das16m1_attach(struct comedi_device *dev,

static void das16m1_detach(struct comedi_device *dev)
{
struct das16m1_private_struct *devpriv = dev->private;

comedi_spriv_free(dev, 3);
if (dev->irq)
free_irq(dev->irq, dev);
if (dev->iobase) {
release_region(dev->iobase, DAS16M1_SIZE);
release_region(dev->iobase + DAS16M1_82C55, DAS16M1_SIZE2);
}
if (devpriv && devpriv->extra_iobase)
release_region(devpriv->extra_iobase, DAS16M1_SIZE2);
comedi_legacy_detach(dev);
}

static struct comedi_driver das16m1_driver = {
Expand Down

0 comments on commit 93bc583

Please sign in to comment.