From: David Schleef Date: Fri, 14 Dec 2001 22:10:56 +0000 (+0000) Subject: Change prototype of subdev_8255_init() (void * -> unsigned long) to make X-Git-Tag: r0_7_62~43 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=10d390ffd842d023f578e171c2f27e2801b7d474;p=comedi.git Change prototype of subdev_8255_init() (void * -> unsigned long) to make it more 64-bit friendly. --- diff --git a/comedi/drivers/8255.c b/comedi/drivers/8255.c index 7e8f30b4..cb30cd18 100644 --- a/comedi/drivers/8255.c +++ b/comedi/drivers/8255.c @@ -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;in_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); diff --git a/comedi/drivers/8255.h b/comedi/drivers/8255.h index c200b05d..20a7bb9e 100644 --- a/comedi/drivers/8255.h +++ b/comedi/drivers/8255.h @@ -28,12 +28,13 @@ #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"); diff --git a/comedi/drivers/amplc_pci230.c b/comedi/drivers/amplc_pci230.c index a57f9aa4..b83b7683 100644 --- a/comedi/drivers/amplc_pci230.c +++ b/comedi/drivers/amplc_pci230.c @@ -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; } diff --git a/comedi/drivers/cb_pcidas.c b/comedi/drivers/cb_pcidas.c index 4fd1bec8..d0d5ee05 100644 --- a/comedi/drivers/cb_pcidas.c +++ b/comedi/drivers/cb_pcidas.c @@ -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. */ diff --git a/comedi/drivers/cb_pcidas64.c b/comedi/drivers/cb_pcidas64.c index 6fa83046..f2583a25 100644 --- a/comedi/drivers/cb_pcidas64.c +++ b/comedi/drivers/cb_pcidas64.c @@ -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); diff --git a/comedi/drivers/cb_pcidda.c b/comedi/drivers/cb_pcidda.c index cb76f3c1..cc6b7b4e 100644 --- a/comedi/drivers/cb_pcidda.c +++ b/comedi/drivers/cb_pcidda.c @@ -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++) diff --git a/comedi/drivers/daqboard2000.c b/comedi/drivers/daqboard2000.c index ac9a4f41..11b3fef3 100644 --- a/comedi/drivers/daqboard2000.c +++ b/comedi/drivers/daqboard2000.c @@ -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: diff --git a/comedi/drivers/das08.c b/comedi/drivers/das08.c index d8e59476..d36b3dbf 100644 --- a/comedi/drivers/das08.c +++ b/comedi/drivers/das08.c @@ -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; diff --git a/comedi/drivers/das16.c b/comedi/drivers/das16.c index 28d2df60..19f9e4dc 100644 --- a/comedi/drivers/das16.c +++ b/comedi/drivers/das16.c @@ -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; diff --git a/comedi/drivers/das16m1.c b/comedi/drivers/das16m1.c index 05a7b96b..72c76191 100644 --- a/comedi/drivers/das16m1.c +++ b/comedi/drivers/das16m1.c @@ -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); diff --git a/comedi/drivers/ni_atmio16d.c b/comedi/drivers/ni_atmio16d.c index 0b748829..fcf490b9 100644 --- a/comedi/drivers/ni_atmio16d.c +++ b/comedi/drivers/ni_atmio16d.c @@ -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; } diff --git a/comedi/drivers/ni_labpc.c b/comedi/drivers/ni_labpc.c index 61ac7956..3bf15e78 100644 --- a/comedi/drivers/ni_labpc.c +++ b/comedi/drivers/ni_labpc.c @@ -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); diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index f5dd58ab..be65409c 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -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); diff --git a/comedi/drivers/ni_pcidio.c b/comedi/drivers/ni_pcidio.c index df95630e..9d39ccbd 100644 --- a/comedi/drivers/ni_pcidio.c +++ b/comedi/drivers/ni_pcidio.c @@ -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;in_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{ diff --git a/comedi/drivers/pcl724.c b/comedi/drivers/pcl724.c index 07d71b58..d92fb09c 100644 --- a/comedi/drivers/pcl724.c +++ b/comedi/drivers/pcl724.c @@ -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;in_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;