Change prototype of subdev_8255_init() (void * -> unsigned long) to make
authorDavid Schleef <ds@schleef.org>
Fri, 14 Dec 2001 22:10:56 +0000 (22:10 +0000)
committerDavid Schleef <ds@schleef.org>
Fri, 14 Dec 2001 22:10:56 +0000 (22:10 +0000)
it more 64-bit friendly.

15 files changed:
comedi/drivers/8255.c
comedi/drivers/8255.h
comedi/drivers/amplc_pci230.c
comedi/drivers/cb_pcidas.c
comedi/drivers/cb_pcidas64.c
comedi/drivers/cb_pcidda.c
comedi/drivers/daqboard2000.c
comedi/drivers/das08.c
comedi/drivers/das16.c
comedi/drivers/das16m1.c
comedi/drivers/ni_atmio16d.c
comedi/drivers/ni_labpc.c
comedi/drivers/ni_mio_common.c
comedi/drivers/ni_pcidio.c
comedi/drivers/pcl724.c

index 7e8f30b4e315c3858c63a6bc6eb15ef206d3a6ef..cb30cd188f55bdbaadf823389942ace456267416 100644 (file)
@@ -81,8 +81,8 @@ chips.
 #define CR_CW          0x80
 
 struct subdev_8255_struct{
-       void *cb_arg;
-       int (*cb_func)(int,int,int,void *);
+       unsigned long cb_arg;
+       int (*cb_func)(int,int,int,unsigned long);
 };
 
 #define CALLBACK_ARG   (((struct subdev_8255_struct *)s->private)->cb_arg)
@@ -100,9 +100,9 @@ COMEDI_INITCLEANUP(driver_8255);
 
 static void do_config(comedi_device *dev,comedi_subdevice *s);
 
-static int subdev_8255_cb(int dir,int port,int data,void *arg)
+static int subdev_8255_cb(int dir,int port,int data,unsigned long arg)
 {
-       int iobase=(unsigned long)arg;
+       int iobase=arg;
 
        if(dir){
                outb(data,iobase+port);
@@ -185,7 +185,7 @@ static void do_config(comedi_device *dev,comedi_subdevice *s)
 }
 
 
-int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,int (*cb)(int,int,int,void *),void *arg)
+int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,int (*cb)(int,int,int,unsigned long),unsigned long arg)
 {
        s->type=COMEDI_SUBD_DIO;
        s->subdev_flags=SDF_READABLE|SDF_WRITEABLE|SDF_RT;
@@ -258,7 +258,7 @@ static int dev_8255_attach(comedi_device *dev,comedi_devconfig *it)
                }else{
                        request_region(iobase,_8255_SIZE,"8255");
 
-                       subdev_8255_init(dev,dev->subdevices+i,NULL,(void *)iobase);
+                       subdev_8255_init(dev,dev->subdevices+i,NULL,iobase);
                }
        }
 
@@ -277,7 +277,7 @@ static int dev_8255_detach(comedi_device *dev)
        for(i=0;i<dev->n_subdevices;i++){
                s=dev->subdevices+i;
                if(s->type!=COMEDI_SUBD_UNUSED){
-                       iobase=(int)CALLBACK_ARG;
+                       iobase=CALLBACK_ARG;
                        release_region(iobase,_8255_SIZE);
                }
                subdev_8255_cleanup(dev,s);
index c200b05d0f19cfd9a8dcc8aa478e48945cad31f9..20a7bb9eaa6b7f2ee3c1be3ad96d68df708b05d2 100644 (file)
 
 #if defined(CONFIG_COMEDI_8255) || defined(CONFIG_COMEDI_8255_MODULE)
 
-int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,int (*cb)(int,int,int,void *),void *arg);
+int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,
+               int (*cb)(int,int,int,unsigned long),unsigned long arg);
 void subdev_8255_cleanup(comedi_device *dev,comedi_subdevice *s);
 
 #else
 
-static inline int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,void *x,void *y)
+static inline int subdev_8255_init(comedi_device *dev,comedi_subdevice *s,void *x,unsigned long y)
 {
        printk("8255 support not configured -- disabling subdevice\n");
 
index a57f9aa48154c509d6070cccc7eb7eb5d3087cb5..b83b768378fc1b059e6c1bab42a7507786104da5 100644 (file)
@@ -430,7 +430,7 @@ static int pci230_attach(comedi_device *dev,comedi_devconfig *it)
        s=dev->subdevices+2;
        /* digital i/o subdevice */
        if(thisboard->have_dio){
-               subdev_8255_init(dev,s,NULL,(void *)(devpriv->pci_iobase + PCI230_PPI_X_A));
+               subdev_8255_init(dev,s,NULL,(devpriv->pci_iobase + PCI230_PPI_X_A));
        }else{
                s->type = COMEDI_SUBD_UNUSED;
        }
index 4fd1bec8f989ef84e2e293580c7b8b5d468d94d7..d0d5ee05f1b56442ce60218c498365ce04038e24 100644 (file)
@@ -658,7 +658,7 @@ found:
        /* 8255 */
        s = dev->subdevices + 2;
        subdev_8255_init(dev, s, NULL,
-               (void *)(devpriv->pacer_counter_dio + DIO_8255));
+               (unsigned long)(devpriv->pacer_counter_dio + DIO_8255));
 
        /* Set bits to enable incoming mailbox interrupts on amcc s5933.
         * They don't actually get sent here, but in cmd code. */
index 6fa8304634676932262761dc8938b502cfc0ddbe..f2583a254b43dece8556bfc1061b7f629abd4ba5 100644 (file)
@@ -441,7 +441,7 @@ static int ai_cmdtest(comedi_device *dev,comedi_subdevice *s, comedi_cmd *cmd);
 static void handle_interrupt(int irq, void *d, struct pt_regs *regs);
 static int ai_cancel(comedi_device *dev, comedi_subdevice *s);
 //static int ao_cancel(comedi_device *dev, comedi_subdevice *s);
-static int dio_callback(int dir, int port, int data, void *arg);
+static int dio_callback(int dir, int port, int data, unsigned long arg);
 static int di_rbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
 static int do_wbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
 static void check_adc_timing(comedi_cmd *cmd);
@@ -741,7 +741,7 @@ printk(" plx dma channel 0 threshold 0x%x\n", readl(devpriv->plx9080_iobase + PL
        /* 8255 */
        s = dev->subdevices + 4;
        subdev_8255_init(dev, s, dio_callback,
-               (void*) (devpriv->dio_counter_iobase + DIO_8255_OFFSET));
+               (unsigned long) (devpriv->dio_counter_iobase + DIO_8255_OFFSET));
 
        // user counter subd XXX
        s = dev->subdevices + 5;
@@ -1367,10 +1367,8 @@ static int ao_readback_insn(comedi_device *dev,comedi_subdevice *s,comedi_insn *
        return 1;
 }
 
-static int dio_callback(int dir, int port, int data, void *arg)
+static int dio_callback(int dir, int port, int data, unsigned long iobase)
 {
-       unsigned long iobase = (int)arg;
-
        if(dir)
        {
                writeb(data, iobase + port);
index cb76f3c118c7b8d8bd9f6286e99b1e90339632e1..cc6b7b4ece2b1a7612c4266d53ae569aefe8e4cd 100644 (file)
@@ -407,10 +407,10 @@ found:
 
        // two 8255 digital io subdevices
        s = dev->subdevices + 1;
-       subdev_8255_init(dev, s, NULL, (void *)(devpriv->digitalio));
+       subdev_8255_init(dev, s, NULL, (unsigned long)(devpriv->digitalio));
        s = dev->subdevices + 2;
        subdev_8255_init(dev, s, NULL,
-               (void *)(devpriv->digitalio + PORT2A));
+               (unsigned long)(devpriv->digitalio + PORT2A));
 
        printk(" eeprom:");
        for(index = 0; index < EEPROM_SIZE; index++)
index ac9a4f4114010f9a2d1b6c37702c8e61e38d09e5..11b3fef32dc46a6d923781ac37e78dadc50bd745 100644 (file)
@@ -674,10 +674,9 @@ The test command, REMOVE!!:
 rmmod daqboard2000 ; rmmod comedi; make install ; modprobe daqboard2000; /usr/sbin/comedi_config /dev/comedi0 daqboard/2000 ; tail -40 /var/log/messages
 */
 
-static int daqboard2000_8255_cb(int dir, int port, int data, void *arg)
+static int daqboard2000_8255_cb(int dir, int port, int data, unsigned long ioaddr)
 {
   int result = 0;
-  unsigned long ioaddr=(unsigned long)arg;
   if(dir){
     writew(data,ioaddr+port*2);
     result = 0;
@@ -823,7 +822,7 @@ static int daqboard2000_attach(comedi_device *dev, comedi_devconfig *it)
 
   s = dev->subdevices + 2;
   result = subdev_8255_init(dev,s,daqboard2000_8255_cb,
-                           (void *)(dev->iobase+0x40));
+                           (unsigned long)(dev->iobase+0x40));
   
   printk("\n");
 out:
index d8e5947621bbe6a9e797a612277fc677a25683ae..d36b3dbf2f520358bd549efde5145dea390c4f93 100644 (file)
@@ -893,7 +893,7 @@ static int das08_attach(comedi_device *dev,comedi_devconfig *it)
        s=dev->subdevices+4;
        /* 8255 */
        if(thisboard->i8255_offset!=0){
-               subdev_8255_init(dev,s,NULL,(void *)(dev->iobase+
+               subdev_8255_init(dev,s,NULL,(unsigned long)(dev->iobase+
                        thisboard->i8255_offset));
        }else{
                s->type=COMEDI_SUBD_UNUSED;
index 28d2df607f5b1af36ea6a950f348523a3a33d1e6..19f9e4dcb9989685afd0e7334585be0b6d55a69c 100644 (file)
@@ -1480,7 +1480,7 @@ static int das16_attach(comedi_device *dev, comedi_devconfig *it)
        s = dev->subdevices + 4;
        /* 8255 */
        if(thisboard->i8255_offset!=0){
-               subdev_8255_init(dev,s,NULL,(void *)(dev->iobase+
+               subdev_8255_init(dev,s,NULL,(unsigned long)(dev->iobase+
                        thisboard->i8255_offset));
        }else{
                s->type = COMEDI_SUBD_UNUSED;
index 05a7b96b961e4f4f5328b44c58d45230f36051ad..72c761910112100cb89f17f075aeccd1bf6e20d7 100644 (file)
@@ -714,7 +714,7 @@ static int das16m1_attach(comedi_device *dev, comedi_devconfig *it)
 
        s = dev->subdevices + 3;
        /* 8255 */
-       subdev_8255_init(dev, s, NULL, (void*)(dev->iobase + DAS16M1_82C55));
+       subdev_8255_init(dev, s, NULL, (unsigned long)(dev->iobase + DAS16M1_82C55));
 
        // disable upper half of hardware conversion counter so it doesn't mess with us
        outb(TOTAL_CLEAR, dev->iobase + DAS16M1_8254_FIRST_CNTRL);
index 0b748829f1c9d2ed6f8e01ff1d4e1d7f130b10a7..fcf490b9898d759516cabc1a46582a74bb99b168 100644 (file)
@@ -839,7 +839,7 @@ static int atmio16d_attach(comedi_device * dev, comedi_devconfig * it)
        /* 8255 subdevice */
        s++;
        if(boardtype->has_8255){
-               subdev_8255_init(dev,s,NULL,(void *)dev->iobase);
+               subdev_8255_init(dev,s,NULL,(unsigned long)dev->iobase);
        }else{
                s->type=COMEDI_SUBD_UNUSED;
        }
index 61ac7956f91a9974a0463035c9281a03961ec2d3..3bf15e7893d9e4c3a76eb7db28482fb8721e0fa0 100644 (file)
@@ -697,7 +697,7 @@ static int labpc_attach(comedi_device *dev, comedi_devconfig *it)
        s = dev->subdevices + 2;
        // if board uses io memory we have to give a custom callback function to the 8255 driver
        if(thisboard->write_byte == labpc_writeb)
-               subdev_8255_init(dev, s, labpc_dio_mem_callback, (void*)(dev->iobase + DIO_BASE_REG));
+               subdev_8255_init(dev, s, labpc_dio_mem_callback, (unsigned long)(dev->iobase + DIO_BASE_REG));
        else
                subdev_8255_init(dev, s, NULL, (void*)(dev->iobase + DIO_BASE_REG));
 
@@ -1767,10 +1767,8 @@ static void labpc_writeb(unsigned int byte, unsigned int address)
        writeb(byte, address);
 }
 
-static int labpc_dio_mem_callback(int dir, int port, int data, void *arg)
+static int labpc_dio_mem_callback(int dir, int port, int data, unsigned long iobase)
 {
-       unsigned long iobase = (int)arg;
-
        if(dir)
        {
                writeb(data, iobase + port);
index f5dd58ab14f446dfa1264d8e518e1c3f0143c158..be65409c8156b66a0b9a8bb57354083c72805a67 100644 (file)
@@ -220,7 +220,7 @@ static int ni_ao_inttrig(comedi_device *dev,comedi_subdevice *s,
 
 static int ni_ao_fifo_half_empty(comedi_device *dev,comedi_subdevice *s);
 
-static int ni_8255_callback(int dir,int port,int data,void *arg);
+static int ni_8255_callback(int dir,int port,int data,unsigned long arg);
 
 static int ni_ns_to_timer(int *nanosec,int round_mode);
 
@@ -2023,7 +2023,7 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it)
        /* 8255 device */
        s=dev->subdevices+3;
        if(boardtype.has_8255){
-               subdev_8255_init(dev,s,ni_8255_callback,dev);
+               subdev_8255_init(dev,s,ni_8255_callback,(unsigned long)dev);
        }else{
                s->type=COMEDI_SUBD_UNUSED;
        }
@@ -2104,9 +2104,9 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it)
 
 
 
-static int ni_8255_callback(int dir,int port,int data,void *arg)
+static int ni_8255_callback(int dir,int port,int data,unsigned long arg)
 {
-       comedi_device *dev=arg;
+       comedi_device *dev=(comedi_device *)arg;
 
        if(dir){
                ni_writeb(data,Port_A+2*port);
index df95630e9f9bde8c7e9ee3a667fd7c8913829fad..9d39ccbd50ebcdc150cd7e458086a4dd4a317858 100644 (file)
@@ -268,10 +268,8 @@ static int nidio_find_device(comedi_device *dev,int bus,int slot);
 static int setup_mite(comedi_device *dev);
 #endif
 
-static int nidio96_8255_cb(int dir,int port,int data,void *arg)
+static int nidio96_8255_cb(int dir,int port,int data,unsigned long iobase)
 {
-       int iobase=(int)arg;
-
        if(dir){
                writeb(data,iobase+port);
                return 0;
@@ -457,7 +455,7 @@ static int nidio_attach(comedi_device *dev,comedi_devconfig *it)
        if(!this_board->is_diodaq){
                for(i=0;i<this_board->n_8255;i++){
                        subdev_8255_init(dev,dev->subdevices+i,
-                               nidio96_8255_cb,(void *)(dev->iobase+NIDIO_8255_BASE(i)));
+                               nidio96_8255_cb,(unsigned long)(dev->iobase+NIDIO_8255_BASE(i)));
                }
        }else{
 
index 07d71b588a91742204e33ef8ef049b0671e6175e..d92fb09cc04177979abffb90a9ee1417f2c769f8 100644 (file)
@@ -102,9 +102,9 @@ comedi_driver driver_pcl724={
 COMEDI_INITCLEANUP(driver_pcl724);
 
 
-static int subdev_8255_cb(int dir,int port,int data,void *arg)
+static int subdev_8255_cb(int dir,int port,int data,unsigned long arg)
 {
-       int iobase=(int)arg;
+       int iobase=arg;
 
        if(dir){
                outb(data,iobase+port);
@@ -114,9 +114,8 @@ static int subdev_8255_cb(int dir,int port,int data,void *arg)
        }
 }
 
-static int subdev_8255mapped_cb(int dir,int port,int data,void *arg)
+static int subdev_8255mapped_cb(int dir,int port,int data,unsigned long iobase)
 {
-       int iobase=(int)arg;
        int movport=SIZE_8255*(iobase>>12);
 
        iobase&=0x0fff;
@@ -186,10 +185,10 @@ static int pcl724_attach(comedi_device *dev,comedi_devconfig *it)
        for(i=0;i<dev->n_subdevices;i++){
                if (this_board->is_pet48) {
                        subdev_8255_init(dev,dev->subdevices+i,
-                               subdev_8255mapped_cb,(void *)(dev->iobase+i*0x1000));
+                               subdev_8255mapped_cb,(unsigned long)(dev->iobase+i*0x1000));
                } else
                        subdev_8255_init(dev,dev->subdevices+i,
-                               subdev_8255_cb,(void *)(dev->iobase+SIZE_8255*i));
+                               subdev_8255_cb,(unsigned long)(dev->iobase+SIZE_8255*i));
        };
 
        return 0;