Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317085
b: refs/heads/master
c: 3cff0f1
h: refs/heads/master
i:
  317083: 5274e15
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jun 5, 2012
1 parent cbaeb72 commit fec8a8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 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: 449b683c6b4f92af648447f9eb449fd52ce6d56b
refs/heads/master: 3cff0f1249f9be93c44ea071bafd9f28f673898d
16 changes: 7 additions & 9 deletions trunk/drivers/staging/comedi/drivers/pcm3724.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ struct priv_pcm3724 {
int dio_2;
};

#define this_board ((const struct pcm3724_board *)dev->board_ptr)

/* (setq c-basic-offset 8) */

static int subdev_8255_cb(int dir, int port, int data, unsigned long arg)
{
unsigned long iobase = arg;
Expand Down Expand Up @@ -234,12 +230,13 @@ static int subdev_3724_insn_config(struct comedi_device *dev,
static int pcm3724_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
const struct pcm3724_board *board = comedi_board(dev);
unsigned long iobase;
unsigned int iorange;
int ret, i, n_subdevices;

iobase = it->options[0];
iorange = this_board->io_range;
iorange = board->io_range;

ret = alloc_private(dev, sizeof(struct priv_pcm3724));
if (ret < 0)
Expand All @@ -249,17 +246,17 @@ static int pcm3724_attach(struct comedi_device *dev,
((struct priv_pcm3724 *)(dev->private))->dio_2 = 0;

printk(KERN_INFO "comedi%d: pcm3724: board=%s, 0x%03lx ", dev->minor,
this_board->name, iobase);
board->name, iobase);
if (!iobase || !request_region(iobase, iorange, "pcm3724")) {
printk("I/O port conflict\n");
return -EIO;
}

dev->iobase = iobase;
dev->board_name = this_board->name;
dev->board_name = board->name;
printk(KERN_INFO "\n");

n_subdevices = this_board->numofports;
n_subdevices = board->numofports;

ret = alloc_subdevices(dev, n_subdevices);
if (ret < 0)
Expand All @@ -275,14 +272,15 @@ static int pcm3724_attach(struct comedi_device *dev,

static void pcm3724_detach(struct comedi_device *dev)
{
const struct pcm3724_board *board = comedi_board(dev);
int i;

if (dev->subdevices) {
for (i = 0; i < dev->n_subdevices; i++)
subdev_8255_cleanup(dev, dev->subdevices + i);
}
if (dev->iobase)
release_region(dev->iobase, this_board->io_range);
release_region(dev->iobase, board->io_range);
}

static const struct pcm3724_board boardtypes[] = {
Expand Down

0 comments on commit fec8a8b

Please sign in to comment.