Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337077
b: refs/heads/master
c: 5f1514b
h: refs/heads/master
i:
  337075: 5e51c80
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent ace7841 commit b413351
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 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: 43fc365f2418b995aef11ca1281399c981448718
refs/heads/master: 5f1514bfd2ffa5e4333c037378a0b0d8db79ce23
32 changes: 7 additions & 25 deletions trunk/drivers/staging/comedi/drivers/pcm3724.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ Copy/pasted/hacked from pcm724.c
#define CR_A_MODE(a) ((a)<<5)
#define CR_CW 0x80

struct pcm3724_board {
const char *name; /* driver name */
int dio; /* num of DIO */
int numofports; /* num of 8255 subdevices */
unsigned int IRQbits; /* allowed interrupts */
unsigned int io_range; /* len of IO space */
};

/* used to track configured dios */
struct priv_pcm3724 {
int dio_1;
Expand Down Expand Up @@ -233,14 +225,15 @@ 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);
struct comedi_subdevice *s;
unsigned long iobase;
unsigned int iorange;
int ret, i, n_subdevices;
int ret, i;

dev->board_name = dev->driver->driver_name;

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

ret = alloc_private(dev, sizeof(struct priv_pcm3724));
if (ret < 0)
Expand All @@ -250,19 +243,16 @@ 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,
board->name, iobase);
dev->board_name, iobase);
if (!iobase || !request_region(iobase, iorange, "pcm3724")) {
printk("I/O port conflict\n");
return -EIO;
}

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

n_subdevices = board->numofports;

ret = comedi_alloc_subdevices(dev, n_subdevices);
ret = comedi_alloc_subdevices(dev, 2);
if (ret)
return ret;

Expand All @@ -277,7 +267,6 @@ static int pcm3724_attach(struct comedi_device *dev,

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

Expand All @@ -288,21 +277,14 @@ static void pcm3724_detach(struct comedi_device *dev)
}
}
if (dev->iobase)
release_region(dev->iobase, board->io_range);
release_region(dev->iobase, PCM3724_SIZE);
}

static const struct pcm3724_board boardtypes[] = {
{ "pcm3724", 48, 2, 0x00fc, PCM3724_SIZE, },
};

static struct comedi_driver pcm3724_driver = {
.driver_name = "pcm3724",
.module = THIS_MODULE,
.attach = pcm3724_attach,
.detach = pcm3724_detach,
.board_name = &boardtypes[0].name,
.num_names = ARRAY_SIZE(boardtypes),
.offset = sizeof(struct pcm3724_board),
};
module_comedi_driver(pcm3724_driver);

Expand Down

0 comments on commit b413351

Please sign in to comment.