Constified ranges, board structures, and miscellaneous data.
[comedi.git] / comedi / drivers / poc.c
index df51a5a49296c4f5ae301e65d769c86c371a04a9..bd7ad8b53ebac452e5a427f7bca9996438c0fc58 100644 (file)
@@ -52,8 +52,8 @@ static int pcl734_insn_bits(comedi_device *dev,comedi_subdevice *s,
        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;
@@ -61,9 +61,9 @@ struct boarddef_struct{
        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,
@@ -95,7 +95,7 @@ static struct boarddef_struct boards[]={
        },
 };
 #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=
 {
@@ -103,7 +103,7 @@ 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]),
 };
@@ -111,10 +111,11 @@ static comedi_driver driver_poc=
 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;
@@ -129,7 +130,7 @@ static int poc_attach(comedi_device *dev, comedi_devconfig *it)
        /* 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;
        }
@@ -207,7 +208,7 @@ static int pcl733_insn_bits(comedi_device *dev,comedi_subdevice *s,
        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);