comedi_insn *insn,lsampl_t *data);
struct boarddef_struct{
- char *name;
- int iosize;
+ const char *name;
+ unsigned int iosize;
int (*setup)(comedi_device *);
int type;
int n_chan;
int (*winsn)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
int (*rinsn)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
int (*insnbits)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
- comedi_lrange* range;
+ const comedi_lrange *range;
};
-static struct boarddef_struct boards[]={
+static const struct boarddef_struct boards[]={
{
name: "dac02",
iosize: 8,
},
};
#define n_boards (sizeof(boards)/sizeof(boards[0]))
-#define this_board ((struct boarddef_struct *)dev->board_ptr)
+#define this_board ((const struct boarddef_struct *)dev->board_ptr)
static comedi_driver driver_poc=
{
module: THIS_MODULE,
attach: poc_attach,
detach: poc_detach,
- board_name: boards,
+ board_name: &boards[0].name,
num_names: n_boards,
offset: sizeof(boards[0]),
};
static int poc_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
- int iosize, iobase;
+ unsigned long iobase;
+ unsigned int iosize;
iobase = it->options[0];
- printk("comedi%d: poc: using %s iobase 0x%x\n", dev->minor,
+ printk("comedi%d: poc: using %s iobase 0x%lx\n", dev->minor,
this_board->name, iobase);
dev->board_name = this_board->name;
/* check if io addresses are available */
if(!request_region(iobase, iosize, "dac02"))
{
- printk("I/O port conflict: failed to allocate ports 0x%x to 0x%x\n",
+ printk("I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n",
iobase, iobase + iosize - 1);
return -EIO;
}
comedi_insn *insn,lsampl_t *data)
{
if(insn->n!=2)return -EINVAL;
-
+
data[1] = inb(dev->iobase + 0);
data[1] |= (inb(dev->iobase + 1) << 8);
data[1] |= (inb(dev->iobase + 2) << 16);