From: Ian Abbott Date: Mon, 7 Aug 2006 17:33:24 +0000 (+0000) Subject: Cleaned up resource types. Used unsigned int for IRQs. Used unsigned long X-Git-Tag: r0_7_72~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=057a2886681bce0105f3e60de907fbec5d49673a;p=comedi.git Cleaned up resource types. Used unsigned int for IRQs. Used unsigned long for I/O ports. Used resource_size_t for physical memory regions. --- diff --git a/comedi/drivers/8255.c b/comedi/drivers/8255.c index fa752385..963ce1e4 100644 --- a/comedi/drivers/8255.c +++ b/comedi/drivers/8255.c @@ -134,7 +134,7 @@ void subdev_8255_interrupt(comedi_device *dev, comedi_subdevice *s) static int subdev_8255_cb(int dir,int port,int data,unsigned long arg) { - int iobase=arg; + unsigned long iobase=arg; if(dir){ outb(data,iobase+port); @@ -362,7 +362,7 @@ void subdev_8255_cleanup(comedi_device *dev,comedi_subdevice *s) static int dev_8255_attach(comedi_device *dev,comedi_devconfig *it) { int ret; - int iobase; + unsigned long iobase; int i; printk("comedi%d: 8255:",dev->minor); @@ -384,7 +384,7 @@ static int dev_8255_attach(comedi_device *dev,comedi_devconfig *it) for(i=0;in_subdevices;i++){ iobase=it->options[i]; - printk(" 0x%04x",iobase); + printk(" 0x%04lx",iobase); if(!request_region(iobase,_8255_SIZE,"8255")){ printk(" (I/O port conflict)"); @@ -401,7 +401,8 @@ static int dev_8255_attach(comedi_device *dev,comedi_devconfig *it) static int dev_8255_detach(comedi_device *dev) { - int i,iobase; + int i; + unsigned long iobase; comedi_subdevice *s; printk("comedi%d: 8255: remove\n",dev->minor); diff --git a/comedi/drivers/adl_pci6208.c b/comedi/drivers/adl_pci6208.c index ba577e89..5b083095 100644 --- a/comedi/drivers/adl_pci6208.c +++ b/comedi/drivers/adl_pci6208.c @@ -122,7 +122,7 @@ COMEDI_INITCLEANUP(driver_pci6208); static int pci6208_find_device(comedi_device *dev, int bus, int slot); static int -pci6208_pci_setup(struct pci_dev *pci_dev, int *io_base_ptr, int dev_minor); +pci6208_pci_setup(struct pci_dev *pci_dev, unsigned long *io_base_ptr, int dev_minor); /*read/write functions*/ static int pci6208_ao_winsn(comedi_device *dev,comedi_subdevice *s, @@ -143,7 +143,8 @@ static int pci6208_ao_rinsn(comedi_device *dev,comedi_subdevice *s, static int pci6208_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; - int retval, io_base; + int retval; + unsigned long io_base; printk("comedi%d: pci6208: ", dev->minor); @@ -358,9 +359,9 @@ found: } static int -pci6208_pci_setup(struct pci_dev *pci_dev, int *io_base_ptr, int dev_minor) +pci6208_pci_setup(struct pci_dev *pci_dev, unsigned long *io_base_ptr, int dev_minor) { - int io_base, io_range, lcr_io_base, lcr_io_range; + unsigned long io_base, io_range, lcr_io_base, lcr_io_range; // Enable PCI device if (pci_enable_device(pci_dev) < 0) { @@ -370,9 +371,9 @@ pci6208_pci_setup(struct pci_dev *pci_dev, int *io_base_ptr, int dev_minor) // Read local configuration register base address [PCI_BASE_ADDRESS #1]. lcr_io_base = pci_resource_start(pci_dev, 1); - lcr_io_range = pci_resource_end(pci_dev, 1) - lcr_io_base +1; + lcr_io_range = pci_resource_len(pci_dev, 1); - printk("comedi%d: local config registers at address 0x%4x [0x%4x]\n", + printk("comedi%d: local config registers at address 0x%4lx [0x%4lx]\n", dev_minor, lcr_io_base, lcr_io_range); @@ -381,7 +382,7 @@ pci6208_pci_setup(struct pci_dev *pci_dev, int *io_base_ptr, int dev_minor) io_base = pci_resource_start (pci_dev, 2); io_range = pci_resource_end (pci_dev, 2) - io_base +1; - printk ("comedi%d: 6208 registers at address 0x%4x [0x%4x]\n", + printk ("comedi%d: 6208 registers at address 0x%4lx [0x%4lx]\n", dev_minor, io_base, io_range); diff --git a/comedi/drivers/adl_pci9111.c b/comedi/drivers/adl_pci9111.c index a147bf5f..070a3f23 100644 --- a/comedi/drivers/adl_pci9111.c +++ b/comedi/drivers/adl_pci9111.c @@ -353,10 +353,10 @@ COMEDI_INITCLEANUP(pci9111_driver); typedef struct { struct pci_dev* pci_device; - int io_range; // PCI6503 io range + unsigned long io_range; // PCI6503 io range - int lcr_io_base; // Local configuration register base address - int lcr_io_range; + unsigned long lcr_io_base; // Local configuration register base address + unsigned long lcr_io_range; int stop_counter; int stop_is_none; @@ -397,7 +397,7 @@ pci9111_private_data_struct; #define PLX9050_PCI_INTERRUPT_ENABLE (1 << 6) #define PLX9050_SOFTWARE_INTERRUPT (1 << 7) -static void plx9050_interrupt_control (int io_base, +static void plx9050_interrupt_control (unsigned long io_base, bool LINTi1_enable, bool LINTi1_active_high, bool LINTi2_enable, @@ -1256,7 +1256,7 @@ static int pci9111_reset (comedi_device *dev) static int pci9111_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *subdevice; - int io_base, io_range, lcr_io_base, lcr_io_range; + unsigned long io_base, io_range, lcr_io_base, lcr_io_range; struct pci_dev* pci_device; int error,i; pci9111_board_struct* board; @@ -1323,9 +1323,9 @@ found: // Read local configuration register base address [PCI_BASE_ADDRESS #1]. lcr_io_base = pci_resource_start (pci_device, 1); - lcr_io_range = pci_resource_end (pci_device, 1) - lcr_io_base +1; + lcr_io_range = pci_resource_len (pci_device, 1); - printk ("comedi%d: local configuration registers at address 0x%4x [0x%4x]\n", + printk ("comedi%d: local configuration registers at address 0x%4lx [0x%4lx]\n", dev->minor, lcr_io_base, lcr_io_range); @@ -1340,9 +1340,9 @@ found: // Read PCI6308 register base address [PCI_BASE_ADDRESS #2]. io_base = pci_resource_start (pci_device, 2); - io_range = pci_resource_end (pci_device, 2) - io_base +1; + io_range = pci_resource_len (pci_device, 2); - printk ("comedi%d: 6503 registers at address 0x%4x [0x%4x]\n", + printk ("comedi%d: 6503 registers at address 0x%4lx [0x%4lx]\n", dev->minor, io_base, io_range); @@ -1374,7 +1374,7 @@ found: PCI9111_DRIVER_NAME, dev)!=0) { - printk ("comedi%d: unable to allocate irq %d\n", dev->minor, pci_device->irq); + printk ("comedi%d: unable to allocate irq %u\n", dev->minor, pci_device->irq); return -EINVAL; } } diff --git a/comedi/drivers/adl_pci9118.c b/comedi/drivers/adl_pci9118.c index e52e4586..d3740337 100644 --- a/comedi/drivers/adl_pci9118.c +++ b/comedi/drivers/adl_pci9118.c @@ -241,7 +241,7 @@ static comedi_driver driver_pci9118={ COMEDI_INITCLEANUP(driver_pci9118); typedef struct{ - int iobase_a; // base+size for AMCC chip + unsigned long iobase_a; // base+size for AMCC chip unsigned int master; // master capable struct pci_dev *pcidev; // ptr to actual pcidev unsigned int usemux; // we want to use external multiplexor! @@ -1668,8 +1668,9 @@ static int pci9118_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; int ret,pages,i; - unsigned short master,irq; - unsigned int iobase_a,iobase_9; + unsigned short master; + unsigned int irq; + unsigned long iobase_a,iobase_9; struct pci_dev *pcidev; int opt_bus, opt_slot; const char *errstr; @@ -1739,7 +1740,7 @@ static int pci9118_attach(comedi_device *dev,comedi_devconfig *it) iobase_a = pci_resource_start(pcidev, 0); iobase_9 = pci_resource_start(pcidev, 2); - rt_printk(", b:s:f=%d:%d:%d, io=0x%4x, 0x%4x",pci_bus,pci_slot,pci_func,iobase_9,iobase_a); + rt_printk(", b:s:f=%d:%d:%d, io=0x%4lx, 0x%4lx",pci_bus,pci_slot,pci_func,iobase_9,iobase_a); dev->iobase=iobase_9; dev->board_name = this_board->name; @@ -1754,7 +1755,7 @@ static int pci9118_attach(comedi_device *dev,comedi_devconfig *it) rt_printk(", unable to allocate IRQ %d, DISABLING IT", irq); irq=0; /* Can't use IRQ */ } else { - rt_printk(", irq=%d", irq); + rt_printk(", irq=%u", irq); } } else { rt_printk(", IRQ disabled"); diff --git a/comedi/drivers/adv_pci1710.c b/comedi/drivers/adv_pci1710.c index eed2315a..ac03e344 100644 --- a/comedi/drivers/adv_pci1710.c +++ b/comedi/drivers/adv_pci1710.c @@ -1220,8 +1220,8 @@ static int pci1710_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; int ret,subdev,n_subdevices; - unsigned short irq; - unsigned int iobase; + unsigned int irq; + unsigned long iobase; struct pci_dev *pcidev; int opt_bus, opt_slot; const char *errstr; @@ -1280,7 +1280,7 @@ static int pci1710_attach(comedi_device *dev,comedi_devconfig *it) irq = pcidev->irq; iobase = pci_resource_start(pcidev, 2); - rt_printk(", b:s:f=%d:%d:%d, io=0x%4x",pci_bus,pci_slot,pci_func,iobase); + rt_printk(", b:s:f=%d:%d:%d, io=0x%4lx",pci_bus,pci_slot,pci_func,iobase); dev->iobase=iobase; @@ -1305,7 +1305,7 @@ static int pci1710_attach(comedi_device *dev,comedi_devconfig *it) rt_printk(", unable to allocate IRQ %d, DISABLING IT", irq); irq=0; /* Can't use IRQ */ } else { - rt_printk(", irq=%d", irq); + rt_printk(", irq=%u", irq); } } else { rt_printk(", IRQ disabled"); diff --git a/comedi/drivers/adv_pci_dio.c b/comedi/drivers/adv_pci_dio.c index 15ab391b..60ac2128 100644 --- a/comedi/drivers/adv_pci_dio.c +++ b/comedi/drivers/adv_pci_dio.c @@ -873,7 +873,8 @@ static int CheckAndAllocCard(comedi_device *dev, comedi_devconfig *it, static int pci_dio_attach(comedi_device *dev, comedi_devconfig *it) { comedi_subdevice *s; - int ret, subdev, n_subdevices, i, j, iobase, found=0; + int ret, subdev, n_subdevices, i, j, found=0; + unsigned long iobase; struct pci_dev* pcidev; rt_printk("comedi%d: adv_pci_dio: board=%s", @@ -916,7 +917,7 @@ static int pci_dio_attach(comedi_device *dev, comedi_devconfig *it) return -EIO; } iobase=pci_resource_start(pcidev, this_board->main_pci_region); - rt_printk(", b:s:f=%d:%d:%d, io=0x%4x", + rt_printk(", b:s:f=%d:%d:%d, io=0x%4lx", pcidev->bus->number, PCI_SLOT(pcidev->devfn), PCI_FUNC(pcidev->devfn), iobase); diff --git a/comedi/drivers/amplc_dio200.c b/comedi/drivers/amplc_dio200.c index 3f4b8fe5..91016fc8 100644 --- a/comedi/drivers/amplc_dio200.c +++ b/comedi/drivers/amplc_dio200.c @@ -1187,7 +1187,8 @@ dio200_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; struct pci_dev *pci_dev = NULL; - int iobase = 0, irq = 0; + unsigned long iobase = 0; + unsigned int irq = 0; int bus = 0, slot = 0; dio200_layout *layout; int share_irq = 0; @@ -1313,21 +1314,21 @@ dio200_attach(comedi_device *dev,comedi_devconfig *it) DIO200_DRIVER_NAME, dev) >= 0) { dev->irq = irq; } else { - printk(KERN_WARNING "comedi%d: warning! irq %d unavailable!\n", + printk(KERN_WARNING "comedi%d: warning! irq %u unavailable!\n", dev->minor, irq); } } printk(KERN_INFO "comedi%d: %s ", dev->minor, dev->board_name); if (thisboard->bustype == isa_bustype) { - printk("(base %#x) ", iobase); + printk("(base %#lx) ", iobase); } else { printk("(pci %02x:%02x.%x) ", pci_dev->bus->number, PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn)); } if (irq) { - printk("(irq %d%s) ", irq, (dev->irq ? "" : " UNAVAILABLE")); + printk("(irq %u%s) ", irq, (dev->irq ? "" : " UNAVAILABLE")); } else { printk("(no irq) "); } diff --git a/comedi/drivers/amplc_pc236.c b/comedi/drivers/amplc_pc236.c index a0a7f658..ac3eefe1 100644 --- a/comedi/drivers/amplc_pc236.c +++ b/comedi/drivers/amplc_pc236.c @@ -117,7 +117,7 @@ MODULE_DEVICE_TABLE(pci, pc236_pci_table); typedef struct{ /* PCI device */ struct pci_dev *pci_dev; - int lcr_iobase; /* PLX PCI9052 config registers in PCIBAR1 */ + unsigned long lcr_iobase; /* PLX PCI9052 config registers in PCIBAR1 */ int enable_irq; }pc236_private; @@ -165,7 +165,8 @@ static int pc236_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; struct pci_dev *pci_dev = NULL; - int iobase = 0, irq = 0; + unsigned long iobase = 0; + unsigned int irq = 0; int bus = 0, slot = 0; struct pci_device_id *pci_id; int share_irq = 0; @@ -303,14 +304,14 @@ static int pc236_attach(comedi_device *dev,comedi_devconfig *it) } } if (thisboard->bustype == isa_bustype) { - printk("(base %#x) ", iobase); + printk("(base %#lx) ", iobase); } else { printk("(pci %02x:%02x.%x) ", pci_dev->bus->number, PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn)); } if (irq) { - printk("(irq %d%s) ", irq, (dev->irq ? "" : " UNAVAILABLE")); + printk("(irq %u%s) ", irq, (dev->irq ? "" : " UNAVAILABLE")); } else { printk("(no irq) "); } diff --git a/comedi/drivers/amplc_pc263.c b/comedi/drivers/amplc_pc263.c index 82bb27a8..abf6020b 100644 --- a/comedi/drivers/amplc_pc263.c +++ b/comedi/drivers/amplc_pc263.c @@ -142,7 +142,7 @@ static int pc263_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; struct pci_dev *pci_dev = NULL; - int iobase = 0; + unsigned long iobase = 0; int bus = 0, slot = 0; struct pci_device_id *pci_id; int ret; @@ -262,7 +262,7 @@ static int pc263_attach(comedi_device *dev,comedi_devconfig *it) s->state = s->state | (inb(dev->iobase) << 8); if (thisboard->bustype == isa_bustype) { - printk("(base %#x) ", iobase); + printk("(base %#lx) ", iobase); } else { printk("(pci %02x:%02x.%x) ", pci_dev->bus->number, PCI_SLOT(pci_dev->devfn), diff --git a/comedi/drivers/amplc_pci224.c b/comedi/drivers/amplc_pci224.c index 01907854..364acdb1 100644 --- a/comedi/drivers/amplc_pci224.c +++ b/comedi/drivers/amplc_pci224.c @@ -1324,7 +1324,7 @@ pci224_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; struct pci_dev *pci_dev; - int irq; + unsigned int irq; int bus = 0, slot = 0; unsigned n; int ret; @@ -1478,7 +1478,7 @@ pci224_attach(comedi_device *dev,comedi_devconfig *it) DRIVER_NAME, dev); if (ret < 0) { printk(KERN_ERR "comedi%d: error! " - "unable to allocate irq %d\n", + "unable to allocate irq %u\n", dev->minor, irq); return ret; } else { @@ -1491,7 +1491,7 @@ pci224_attach(comedi_device *dev,comedi_devconfig *it) PCI_SLOT(pci_dev->devfn), PCI_FUNC(pci_dev->devfn)); if (irq) { - printk("(irq %d%s) ", irq, (dev->irq ? "" : " UNAVAILABLE")); + printk("(irq %u%s) ", irq, (dev->irq ? "" : " UNAVAILABLE")); } else { printk("(no irq) "); } diff --git a/comedi/drivers/amplc_pci230.c b/comedi/drivers/amplc_pci230.c index 24ab4770..c4f75fe8 100644 --- a/comedi/drivers/amplc_pci230.c +++ b/comedi/drivers/amplc_pci230.c @@ -207,7 +207,7 @@ MODULE_DEVICE_TABLE(pci, pci230_pci_table); struct pci230_private{ struct pci_dev *pci_dev; lsampl_t ao_readback[2]; /* Used for AO readback */ - unsigned int pci_iobase; /* PCI230's I/O space 1 */ + unsigned long pci_iobase; /* PCI230's I/O space 1 */ /* Divisors for 8254 counter/timer. */ unsigned int clk_src0; /* which clock to use for the counter/timers: 10MHz, 1MHz, 100kHz etc */ unsigned int clk_src1; @@ -331,7 +331,7 @@ static void pci230_ao_write(comedi_device *dev, sampl_t data, int chan) static int pci230_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; - int pci_iobase, iobase = 0; /* PCI230's I/O spaces 1 and 2 respectively. */ + unsigned long pci_iobase, iobase; /* PCI230's I/O spaces 1 and 2 respectively. */ struct pci_dev *pci_dev; int i=0,irq_hdl; @@ -375,7 +375,7 @@ static int pci230_attach(comedi_device *dev,comedi_devconfig *it) return -EIO; } - printk("comedi%d: amplc_pci230: I/O region 1 0x%04x I/O region 2 0x%04x\n",dev->minor, pci_iobase, iobase); + printk("comedi%d: amplc_pci230: I/O region 1 0x%04lx I/O region 2 0x%04lx\n",dev->minor, pci_iobase, iobase); devpriv->pci_iobase = pci_iobase; dev->iobase = iobase; @@ -396,7 +396,7 @@ static int pci230_attach(comedi_device *dev,comedi_devconfig *it) } else { dev->irq = devpriv->pci_dev->irq; - printk("comedi%d: amplc_pci230: registered irq %d\n", dev->minor, devpriv->pci_dev->irq); + printk("comedi%d: amplc_pci230: registered irq %u\n", dev->minor, devpriv->pci_dev->irq); } /* diff --git a/comedi/drivers/c6xdigio.c b/comedi/drivers/c6xdigio.c index 60918c1b..9899ce90 100644 --- a/comedi/drivers/c6xdigio.c +++ b/comedi/drivers/c6xdigio.c @@ -48,13 +48,13 @@ http://robot0.ge.uiuc.edu/~spong/mecha/ #include #include -static u8 ReadByteFromHwPort(int addr) +static u8 ReadByteFromHwPort(unsigned long addr) { u8 result = inb(addr); return result; } -static void WriteByteToHwPort(int addr, u8 val) +static void WriteByteToHwPort(unsigned long addr, u8 val) { outb_p(val, addr); } @@ -103,7 +103,7 @@ comedi_driver driver_c6xdigio={ detach: c6xdigio_detach, }; -static void C6X_pwmInit( unsigned baseAddr ) { +static void C6X_pwmInit( unsigned long baseAddr ) { int timeout=0; //printk("Inside C6X_pwmInit\n"); @@ -133,7 +133,7 @@ static void C6X_pwmInit( unsigned baseAddr ) { } -static void C6X_pwmOutput( unsigned baseAddr, unsigned channel, int value ) +static void C6X_pwmOutput( unsigned long baseAddr, unsigned channel, int value ) { unsigned ppcmd; union pwmcmdtype pwm; @@ -202,7 +202,7 @@ static void C6X_pwmOutput( unsigned baseAddr, unsigned channel, int value ) } -static int C6X_encInput( unsigned baseAddr, unsigned channel) +static int C6X_encInput( unsigned long baseAddr, unsigned channel) { unsigned ppcmd; union encvaluetype enc; @@ -301,7 +301,7 @@ static int C6X_encInput( unsigned baseAddr, unsigned channel) return(enc.value ^ 0x800000); } -static void C6X_encResetAll( unsigned baseAddr ) +static void C6X_encResetAll( unsigned long baseAddr ) { unsigned timeout=0; @@ -429,12 +429,12 @@ static struct pnp_driver c6xdigio_pnp_driver = { static int c6xdigio_attach(comedi_device * dev, comedi_devconfig * it) { int result = 0; - int iobase; - int irq; + unsigned long iobase; + unsigned int irq; comedi_subdevice *s; iobase = it->options[0]; - printk("comedi%d: c6xdigio: 0x%04x\n", dev->minor, iobase); + printk("comedi%d: c6xdigio: 0x%04lx\n", dev->minor, iobase); if (!request_region(iobase, C6XDIGIO_SIZE, "c6xdigio")) { printk("comedi%d: I/O port conflict\n", dev->minor); return -EIO; @@ -451,7 +451,7 @@ static int c6xdigio_attach(comedi_device * dev, comedi_devconfig * it) irq = it->options[1]; if (irq > 0) { - printk("comedi%d: irq = %d ignored\n", dev->minor, irq); + printk("comedi%d: irq = %u ignored\n", dev->minor, irq); } else if(irq == 0) { printk("comedi%d: no irq\n", dev->minor); } diff --git a/comedi/drivers/cb_das16_cs.c b/comedi/drivers/cb_das16_cs.c index 29e0f675..aa38a195 100644 --- a/comedi/drivers/cb_das16_cs.c +++ b/comedi/drivers/cb_das16_cs.c @@ -187,7 +187,7 @@ static int das16cs_attach(comedi_device *dev,comedi_devconfig *it) return ret; } dev->irq = link->irq.AssignedIRQ; - printk("irq=%d ",dev->irq); + printk("irq=%u ",dev->irq); dev->board_ptr = das16cs_probe(dev, link); if(!dev->board_ptr)return -EIO; @@ -949,7 +949,7 @@ static void das16cs_pcmcia_config(dev_link_t *link) if (link->conf.Vpp1) printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10); if (link->conf.Attributes & CONF_ENABLE_IRQ) - printk(", irq %d", link->irq.AssignedIRQ); + printk(", irq %u", link->irq.AssignedIRQ); if (link->io.NumPorts1) printk(", io 0x%04x-0x%04x", link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1-1); diff --git a/comedi/drivers/cb_pcidas.c b/comedi/drivers/cb_pcidas.c index 8c573213..3975d0c3 100644 --- a/comedi/drivers/cb_pcidas.c +++ b/comedi/drivers/cb_pcidas.c @@ -408,11 +408,11 @@ typedef struct /* would be useful for a PCI device */ struct pci_dev *pci_dev; // base addresses - unsigned int s5933_config; - unsigned int control_status; - unsigned int adc_fifo; - unsigned int pacer_counter_dio; - unsigned int ao_registers; + unsigned long s5933_config; + unsigned long control_status; + unsigned long adc_fifo; + unsigned long pacer_counter_dio; + unsigned long ao_registers; // divisors of master clock for analog input pacing unsigned int divisor1; unsigned int divisor2; @@ -646,8 +646,7 @@ found: /* 8255 */ s = dev->subdevices + 2; - subdev_8255_init(dev, s, NULL, - (unsigned long)(devpriv->pacer_counter_dio + DIO_8255)); + subdev_8255_init(dev, s, NULL, devpriv->pacer_counter_dio + DIO_8255); // serial EEPROM, s = dev->subdevices + 3; diff --git a/comedi/drivers/cb_pcidas64.c b/comedi/drivers/cb_pcidas64.c index 68900bdb..7aa3f4cc 100644 --- a/comedi/drivers/cb_pcidas64.c +++ b/comedi/drivers/cb_pcidas64.c @@ -1088,9 +1088,9 @@ typedef struct { struct pci_dev *hw_dev; // pointer to board's pci_dev struct // base addresses (physical) - unsigned long plx9080_phys_iobase; - unsigned long main_phys_iobase; - unsigned long dio_counter_phys_iobase; + resource_size_t plx9080_phys_iobase; + resource_size_t main_phys_iobase; + resource_size_t dio_counter_phys_iobase; // base addresses (ioremapped) void *plx9080_iobase; void *main_iobase; @@ -1729,17 +1729,17 @@ static int attach(comedi_device *dev, comedi_devconfig *it) return -ENOMEM; } - DEBUG_PRINT(" plx9080 remapped to 0x%lx\n", priv(dev)->plx9080_iobase); - DEBUG_PRINT(" main remapped to 0x%lx\n", priv(dev)->main_iobase); - DEBUG_PRINT(" diocounter remapped to 0x%lx\n", priv(dev)->dio_counter_iobase); + DEBUG_PRINT(" plx9080 remapped to 0x%p\n", priv(dev)->plx9080_iobase); + DEBUG_PRINT(" main remapped to 0x%p\n", priv(dev)->main_iobase); + DEBUG_PRINT(" diocounter remapped to 0x%p\n", priv(dev)->dio_counter_iobase); // figure out what local addresses are local_range = readl(priv(dev)->plx9080_iobase + PLX_LAS0RNG_REG) & LRNG_MEM_MASK; local_decode = readl(priv(dev)->plx9080_iobase + PLX_LAS0MAP_REG) & local_range & LMAP_MEM_MASK ; - priv(dev)->local0_iobase = (priv(dev)->main_phys_iobase & ~local_range) | local_decode; + priv(dev)->local0_iobase = ((uint32_t)priv(dev)->main_phys_iobase & ~local_range) | local_decode; local_range = readl(priv(dev)->plx9080_iobase + PLX_LAS1RNG_REG) & LRNG_MEM_MASK; local_decode = readl(priv(dev)->plx9080_iobase + PLX_LAS1MAP_REG) & local_range & LMAP_MEM_MASK ; - priv(dev)->local1_iobase = (priv(dev)->dio_counter_phys_iobase & ~local_range) | local_decode; + priv(dev)->local1_iobase = ((uint32_t)priv(dev)->dio_counter_phys_iobase & ~local_range) | local_decode; DEBUG_PRINT(" local 0 io addr 0x%x\n", priv(dev)->local0_iobase); DEBUG_PRINT(" local 1 io addr 0x%x\n", priv(dev)->local1_iobase); @@ -1752,11 +1752,11 @@ static int attach(comedi_device *dev, comedi_devconfig *it) // get irq if(comedi_request_irq(pcidev->irq, handle_interrupt, SA_SHIRQ, "cb_pcidas64", dev )) { - printk(" unable to allocate irq %d\n", pcidev->irq); + printk(" unable to allocate irq %u\n", pcidev->irq); return -EINVAL; } dev->irq = pcidev->irq; - printk(" irq %i\n", dev->irq); + printk(" irq %u\n", dev->irq); init_plx9080(dev); init_stc_registers( dev ); diff --git a/comedi/drivers/cb_pcidda.c b/comedi/drivers/cb_pcidda.c index 100d1054..080eb9ad 100644 --- a/comedi/drivers/cb_pcidda.c +++ b/comedi/drivers/cb_pcidda.c @@ -363,10 +363,9 @@ found: // two 8255 digital io subdevices s = dev->subdevices + 1; - subdev_8255_init(dev, s, NULL, (unsigned long)(devpriv->digitalio)); + subdev_8255_init(dev, s, NULL, devpriv->digitalio); s = dev->subdevices + 2; - subdev_8255_init(dev, s, NULL, - (unsigned long)(devpriv->digitalio + PORT2A)); + subdev_8255_init(dev, s, NULL, devpriv->digitalio + PORT2A); printk(" eeprom:"); for(index = 0; index < EEPROM_SIZE; index++) diff --git a/comedi/drivers/cb_pcimdas.c b/comedi/drivers/cb_pcimdas.c index 16ee8575..e9b3b75f 100644 --- a/comedi/drivers/cb_pcimdas.c +++ b/comedi/drivers/cb_pcimdas.c @@ -146,11 +146,11 @@ typedef struct{ struct pci_dev *pci_dev; //base addresses - unsigned int BADR0; - unsigned int BADR1; - unsigned int BADR2; - unsigned int BADR3; - unsigned int BADR4; + unsigned long BADR0; + unsigned long BADR1; + unsigned long BADR2; + unsigned long BADR3; + unsigned long BADR4; /* Used for AO readback */ lsampl_t ao_readback[2]; @@ -278,11 +278,11 @@ found: devpriv->BADR4 = pci_resource_start(devpriv->pci_dev, 4); #ifdef CBPCIMDAS_DEBUG - printk("devpriv->BADR0 = %d\n",devpriv->BADR0); - printk("devpriv->BADR1 = %d\n",devpriv->BADR1); - printk("devpriv->BADR2 = %d\n",devpriv->BADR2); - printk("devpriv->BADR3 = %d\n",devpriv->BADR3); - printk("devpriv->BADR4 = %d\n",devpriv->BADR4); + printk("devpriv->BADR0 = 0x%lx\n",devpriv->BADR0); + printk("devpriv->BADR1 = 0x%lx\n",devpriv->BADR1); + printk("devpriv->BADR2 = 0x%lx\n",devpriv->BADR2); + printk("devpriv->BADR3 = 0x%lx\n",devpriv->BADR3); + printk("devpriv->BADR4 = 0x%lx\n",devpriv->BADR4); #endif @@ -290,7 +290,7 @@ found: // // get irq // if(comedi_request_irq(devpriv->pci_dev->irq, cb_pcimdas_interrupt, SA_SHIRQ, "cb_pcimdas", dev )) // { -// printk(" unable to allocate irq %d\n", devpriv->pci_dev->irq); +// printk(" unable to allocate irq %u\n", devpriv->pci_dev->irq); // return -EINVAL; // } // dev->irq = devpriv->pci_dev->irq; @@ -331,8 +331,7 @@ found: s = dev->subdevices + 2; /* digital i/o subdevice */ if(thisboard->has_dio){ - subdev_8255_init(dev, s, NULL, - (unsigned long)(devpriv->BADR4)); + subdev_8255_init(dev, s, NULL, devpriv->BADR4); }else{ s->type = COMEDI_SUBD_UNUSED; } @@ -356,11 +355,11 @@ static int cb_pcimdas_detach(comedi_device *dev) #ifdef CBPCIMDAS_DEBUG if(devpriv) { - printk("devpriv->BADR0 = %d\n",devpriv->BADR0); - printk("devpriv->BADR1 = %d\n",devpriv->BADR1); - printk("devpriv->BADR2 = %d\n",devpriv->BADR2); - printk("devpriv->BADR3 = %d\n",devpriv->BADR3); - printk("devpriv->BADR4 = %d\n",devpriv->BADR4); + printk("devpriv->BADR0 = 0x%lx\n",devpriv->BADR0); + printk("devpriv->BADR1 = 0x%lx\n",devpriv->BADR1); + printk("devpriv->BADR2 = 0x%lx\n",devpriv->BADR2); + printk("devpriv->BADR3 = 0x%lx\n",devpriv->BADR3); + printk("devpriv->BADR4 = 0x%lx\n",devpriv->BADR4); } #endif printk("comedi%d: cb_pcimdas: remove\n",dev->minor); diff --git a/comedi/drivers/cb_pcimdda.c b/comedi/drivers/cb_pcimdda.c index 8734345f..1ea66a6d 100644 --- a/comedi/drivers/cb_pcimdda.c +++ b/comedi/drivers/cb_pcimdda.c @@ -157,8 +157,8 @@ MODULE_DEVICE_TABLE(pci, pci_table); several hardware drivers keep similar information in this structure, feel free to suggest moving the variable to the comedi_device struct. */ typedef struct { - int registers; /* set by probe */ - int dio_registers; + unsigned long registers; /* set by probe */ + unsigned long dio_registers; char attached_to_8255; /* boolean */ char attached_successfully; /* boolean */ /* would be useful for a PCI device */ @@ -302,8 +302,7 @@ static int attach(comedi_device *dev,comedi_devconfig *it) switch(thisboard->dio_method) { case DIO_8255: /* this is a straight 8255, so register us with the 8255 driver */ - subdev_8255_init(dev, s, NULL, - (unsigned long)(devpriv->dio_registers)); + subdev_8255_init(dev, s, NULL, devpriv->dio_registers); devpriv->attached_to_8255 = 1; break; case DIO_INTERNAL: @@ -366,7 +365,7 @@ static int ao_winsn(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, { int i; int chan = CR_CHAN(insn->chanspec); - int offset = devpriv->registers + chan*2; + unsigned long offset = devpriv->registers + chan*2; /* Writing a list of values to an AO channel is probably not * very useful, but that's how the interface is defined. */ @@ -439,8 +438,9 @@ static int ao_rinsn(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, */ static int probe(comedi_device *dev, const comedi_devconfig *it) { - struct pci_dev *pcidev; - int index, registers; + struct pci_dev *pcidev; + int index; + unsigned long registers; for(pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL); pcidev != NULL ; pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pcidev)) diff --git a/comedi/drivers/comedi_parport.c b/comedi/drivers/comedi_parport.c index e6cf461a..7c8c9814 100644 --- a/comedi/drivers/comedi_parport.c +++ b/comedi/drivers/comedi_parport.c @@ -284,12 +284,12 @@ static irqreturn_t parport_interrupt(int irq,void *d,struct pt_regs *regs) static int parport_attach(comedi_device *dev,comedi_devconfig *it) { int ret; - int irq; - int iobase; + unsigned int irq; + unsigned long iobase; comedi_subdevice *s; iobase=it->options[0]; - printk("comedi%d: parport: 0x%04x ",dev->minor,iobase); + printk("comedi%d: parport: 0x%04lx ",dev->minor,iobase); if(!request_region(iobase,PARPORT_SIZE,"parport (comedi)")){ printk("I/O port conflict\n"); return -EIO; @@ -298,7 +298,7 @@ static int parport_attach(comedi_device *dev,comedi_devconfig *it) irq=it->options[1]; if(irq){ - printk(" irq=%d",irq); + printk(" irq=%u",irq); ret = comedi_request_irq(irq,parport_interrupt,0, "comedi_parport",dev); if(ret<0){ diff --git a/comedi/drivers/das08_cs.c b/comedi/drivers/das08_cs.c index 8f7d2f32..10927c3e 100644 --- a/comedi/drivers/das08_cs.c +++ b/comedi/drivers/das08_cs.c @@ -459,7 +459,7 @@ static void das08_pcmcia_config(dev_link_t *link) if (link->conf.Vpp1) printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10); if (link->conf.Attributes & CONF_ENABLE_IRQ) - printk(", irq %d", link->irq.AssignedIRQ); + printk(", irq %u", link->irq.AssignedIRQ); if (link->io.NumPorts1) printk(", io 0x%04x-0x%04x", link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1-1); diff --git a/comedi/drivers/das16.c b/comedi/drivers/das16.c index 0b8de4cf..984feecd 100644 --- a/comedi/drivers/das16.c +++ b/comedi/drivers/das16.c @@ -1384,9 +1384,10 @@ static int das1600_mode_detect(comedi_device *dev) static int das16_attach(comedi_device *dev, comedi_devconfig *it) { comedi_subdevice *s; - int ret, irq; - int iobase; - int dma_chan; + int ret; + unsigned int irq; + unsigned long iobase; + unsigned int dma_chan; int timer_mode; unsigned long flags; comedi_krange *user_ai_range, *user_ao_range; @@ -1420,23 +1421,23 @@ static int das16_attach(comedi_device *dev, comedi_devconfig *it) return ret; if(thisboard->size<0x400){ - printk(" 0x%04x-0x%04x\n", iobase, iobase+thisboard->size); + printk(" 0x%04lx-0x%04lx\n", iobase, iobase+thisboard->size); if(!request_region(iobase,thisboard->size,"das16")){ printk(" I/O port conflict\n"); return -EIO; } }else{ - printk(" 0x%04x-0x%04x 0x%04x-0x%04x\n", + printk(" 0x%04lx-0x%04lx 0x%04lx-0x%04lx\n", iobase,iobase+0x0f, iobase+0x400,iobase+0x400+(thisboard->size&0x3ff)); if(!request_region(iobase,0x10,"das16")){ - printk(" I/O port conflict: 0x%04x-0x%04x\n", + printk(" I/O port conflict: 0x%04lx-0x%04lx\n", iobase,iobase+0x0f); return -EIO; } if(!request_region(iobase+0x400,thisboard->size&0x3ff,"das16")){ release_region(iobase, 0x10); - printk(" I/O port conflict: 0x%04x-0x%04x\n", + printk(" I/O port conflict: 0x%04lx-0x%04lx\n", iobase+0x400, iobase+0x400+(thisboard->size&0x3ff)); return -EIO; @@ -1471,7 +1472,7 @@ static int das16_attach(comedi_device *dev, comedi_devconfig *it) if((ret=comedi_request_irq(irq, das16_dma_interrupt, 0, "das16",dev)) < 0) return ret; dev->irq = irq; - printk(" ( irq = %d )",irq); + printk(" ( irq = %u )",irq); }else if(irq == 0){ printk(" ( no irq )"); }else @@ -1503,7 +1504,7 @@ static int das16_attach(comedi_device *dev, comedi_devconfig *it) disable_dma(devpriv->dma_chan); set_dma_mode(devpriv->dma_chan, DMA_MODE_READ); release_dma_lock(flags); - printk(" ( dma = %d)\n", dma_chan); + printk(" ( dma = %u)\n", dma_chan); }else if(dma_chan == 0){ printk(" ( no dma )\n"); }else @@ -1634,7 +1635,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,(unsigned long)(dev->iobase+ + subdev_8255_init(dev,s,NULL,(dev->iobase+ thisboard->i8255_offset)); }else{ s->type = COMEDI_SUBD_UNUSED; diff --git a/comedi/drivers/das16m1.c b/comedi/drivers/das16m1.c index 3472811a..1db001b5 100644 --- a/comedi/drivers/das16m1.c +++ b/comedi/drivers/das16m1.c @@ -633,8 +633,9 @@ static int das16m1_irq_bits(unsigned int irq) static int das16m1_attach(comedi_device *dev, comedi_devconfig *it) { comedi_subdevice *s; - int ret, irq; - int iobase; + int ret; + unsigned int irq; + unsigned long iobase; iobase = it->options[0]; @@ -645,7 +646,7 @@ static int das16m1_attach(comedi_device *dev, comedi_devconfig *it) dev->board_name = thisboard->name; - printk(" io 0x%x-0x%x 0x%x-0x%x", + printk(" io 0x%lx-0x%lx 0x%lx-0x%lx", iobase, iobase + DAS16M1_SIZE, iobase + DAS16M1_82C55, iobase + DAS16M1_82C55 + DAS16M1_SIZE2); if(!request_region(iobase, DAS16M1_SIZE, driver_das16m1.driver_name)) { @@ -672,7 +673,7 @@ static int das16m1_attach(comedi_device *dev, comedi_devconfig *it) return ret; } dev->irq = irq; - printk(", irq %d\n", irq); + printk(", irq %u\n", irq); }else if(irq == 0){ printk(", no irq\n"); }else { @@ -720,7 +721,7 @@ static int das16m1_attach(comedi_device *dev, comedi_devconfig *it) s = dev->subdevices + 3; /* 8255 */ - subdev_8255_init(dev, s, NULL, (unsigned long)(dev->iobase + DAS16M1_82C55)); + subdev_8255_init(dev, s, NULL, 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/das1800.c b/comedi/drivers/das1800.c index b799ab25..fd7e3d59 100644 --- a/comedi/drivers/das1800.c +++ b/comedi/drivers/das1800.c @@ -468,7 +468,7 @@ typedef struct{ uint16_t *ai_buf1; uint16_t *dma_current_buf; /* pointer to dma buffer currently being used */ unsigned int dma_transfer_size; /* size of transfer currently used, in bytes */ - int iobase2; /* secondary io address used for analog out on 'ao' boards */ + unsigned long iobase2; /* secondary io address used for analog out on 'ao' boards */ short ao_update_bits; /* remembers the last write to the 'update' dac */ }das1800_private; @@ -586,11 +586,11 @@ static int das1800_init_dma( comedi_device *dev, unsigned int dma0, unsigned int static int das1800_attach(comedi_device *dev, comedi_devconfig *it) { comedi_subdevice *s; - int iobase = it->options[0]; - int irq = it->options[1]; - int dma0 = it->options[2]; - int dma1 = it->options[3]; - int iobase2; + unsigned long iobase = it->options[0]; + unsigned int irq = it->options[1]; + unsigned int dma0 = it->options[2]; + unsigned int dma1 = it->options[3]; + unsigned long iobase2; int board; int retval; @@ -598,14 +598,14 @@ static int das1800_attach(comedi_device *dev, comedi_devconfig *it) if(alloc_private(dev, sizeof(das1800_private)) < 0) return -ENOMEM; - printk("comedi%d: %s: io 0x%x", dev->minor, driver_das1800.driver_name, iobase); + printk("comedi%d: %s: io 0x%lx", dev->minor, driver_das1800.driver_name, iobase); if(irq) { - printk(", irq %i", irq); + printk(", irq %u", irq); if(dma0) { - printk(", dma %i", dma0); - if(dma1) printk(" and %i", dma1); + printk(", dma %u", dma0); + if(dma1) printk(" and %u", dma1); } } printk("\n"); @@ -619,7 +619,7 @@ static int das1800_attach(comedi_device *dev, comedi_devconfig *it) /* check if io addresses are available */ if(!request_region(iobase, DAS1800_SIZE, driver_das1800.driver_name)) { - 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 + DAS1800_SIZE - 1); return -EIO; } @@ -641,7 +641,7 @@ static int das1800_attach(comedi_device *dev, comedi_devconfig *it) iobase2 = iobase + IOBASE2; if(!request_region(iobase2, DAS1800_SIZE, driver_das1800.driver_name)) { - 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", iobase2, iobase2 + DAS1800_SIZE - 1); return -EIO; } @@ -653,7 +653,7 @@ static int das1800_attach(comedi_device *dev, comedi_devconfig *it) { if(comedi_request_irq( irq, das1800_interrupt, 0, driver_das1800.driver_name, dev )) { - printk(" unable to allocate irq %d\n", irq); + printk(" unable to allocate irq %u\n", irq); return -EINVAL; } } diff --git a/comedi/drivers/das6402.c b/comedi/drivers/das6402.c index d9706151..f2dc3da7 100644 --- a/comedi/drivers/das6402.c +++ b/comedi/drivers/das6402.c @@ -299,8 +299,8 @@ static int das6402_detach(comedi_device *dev) static int das6402_attach(comedi_device *dev,comedi_devconfig *it) { - int irq; - int iobase; + unsigned int irq; + unsigned long iobase; int ret; comedi_subdevice *s; @@ -320,7 +320,7 @@ static int das6402_attach(comedi_device *dev,comedi_devconfig *it) /* should do a probe here */ irq=it->options[0]; - printk(" ( irq = %d )", irq); + printk(" ( irq = %u )", irq); ret=comedi_request_irq(irq, intr_handler, 0, "das6402", dev); if(ret<0){ printk("irq conflict\n"); diff --git a/comedi/drivers/das800.c b/comedi/drivers/das800.c index f1d83c4b..61f49976 100644 --- a/comedi/drivers/das800.c +++ b/comedi/drivers/das800.c @@ -454,15 +454,15 @@ static irqreturn_t das800_interrupt(int irq, void *d, struct pt_regs *regs) static int das800_attach(comedi_device *dev, comedi_devconfig *it) { comedi_subdevice *s; - int iobase = it->options[0]; - int irq = it->options[1]; + unsigned long iobase = it->options[0]; + unsigned int irq = it->options[1]; unsigned long irq_flags; int board; - printk("comedi%d: das800: io 0x%x", dev->minor, iobase); + printk("comedi%d: das800: io 0x%lx", dev->minor, iobase); if(irq) { - printk(", irq %i", irq); + printk(", irq %u", irq); } printk("\n"); @@ -493,7 +493,7 @@ static int das800_attach(comedi_device *dev, comedi_devconfig *it) dev->board_ptr = das800_boards + board; /* grab our IRQ */ - if(irq == 1 || irq > 7 || irq < 0) + if(irq == 1 || irq > 7) { printk("irq out of range\n"); return -EINVAL; @@ -502,7 +502,7 @@ static int das800_attach(comedi_device *dev, comedi_devconfig *it) { if(comedi_request_irq( irq, das800_interrupt, 0, "das800", dev )) { - printk( "unable to allocate irq %d\n", irq); + printk( "unable to allocate irq %u\n", irq); return -EINVAL; } } diff --git a/comedi/drivers/dt2801.c b/comedi/drivers/dt2801.c index eeea7072..3f750fae 100644 --- a/comedi/drivers/dt2801.c +++ b/comedi/drivers/dt2801.c @@ -486,7 +486,7 @@ static comedi_lrange *ai_range_lkup(int type,int opt) static int dt2801_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; - int iobase; + unsigned long iobase; int board_code,type; int ret=0; int n_ai_chans; @@ -514,7 +514,7 @@ static int dt2801_attach(comedi_device *dev,comedi_devconfig *it) havetype: dev->board_ptr = boardtypes+type; - printk("dt2801: %s at port 0x%x",boardtype.name,iobase); + printk("dt2801: %s at port 0x%lx",boardtype.name,iobase); n_ai_chans=probe_number_of_ai_chans(dev); printk(" (ai channels = %d)",n_ai_chans); diff --git a/comedi/drivers/dt2811.c b/comedi/drivers/dt2811.c index 494e0d4b..91db38bd 100644 --- a/comedi/drivers/dt2811.c +++ b/comedi/drivers/dt2811.c @@ -297,15 +297,16 @@ static void dt2811_interrupt(int irq, void *d, struct pt_regs *regs) static int dt2811_attach(comedi_device * dev, comedi_devconfig * it) { - //int i, irq, irqs; + //int i, irq; + //unsigned long irqs; //long flags; int ret; comedi_subdevice *s; - int iobase; + unsigned long iobase; iobase = it->options[0]; - printk("comedi%d: dt2811: base=0x%04x\n", dev->minor, iobase); + printk("comedi%d: dt2811: base=0x%04lx\n", dev->minor, iobase); if (!request_region(iobase, DT2811_SIZE, driver_name)) { printk("I/O port conflict\n"); diff --git a/comedi/drivers/dt2814.c b/comedi/drivers/dt2814.c index eea18365..30f8a671 100644 --- a/comedi/drivers/dt2814.c +++ b/comedi/drivers/dt2814.c @@ -237,10 +237,10 @@ static int dt2814_attach(comedi_device *dev,comedi_devconfig *it) int i,irq; int ret; comedi_subdevice *s; - int iobase; + unsigned long iobase; iobase=it->options[0]; - printk("comedi%d: dt2814: 0x%04lx ",dev->minor,dev->iobase); + printk("comedi%d: dt2814: 0x%04lx ",dev->minor,iobase); if(!request_region(iobase,DT2814_SIZE,"dt2814")){ printk("I/O port conflict\n"); return -EIO; @@ -286,7 +286,11 @@ static int dt2814_attach(comedi_device *dev,comedi_devconfig *it) }else if(irq==0){ printk("(no irq)\n"); }else{ +#if 0 printk("(probe returned multiple irqs--bad)\n"); +#else + printk("(irq probe not implemented)\n"); +#endif } if((ret=alloc_subdevices(dev, 1))<0) diff --git a/comedi/drivers/dt2815.c b/comedi/drivers/dt2815.c index aafe13de..a8e61602 100644 --- a/comedi/drivers/dt2815.c +++ b/comedi/drivers/dt2815.c @@ -178,10 +178,10 @@ static int dt2815_attach(comedi_device * dev, comedi_devconfig * it) comedi_subdevice *s; int i; comedi_lrange *current_range_type, *voltage_range_type; - int iobase; + unsigned long iobase; iobase = it->options[0]; - printk("comedi%d: dt2815: 0x%04x ", dev->minor, iobase); + printk("comedi%d: dt2815: 0x%04lx ", dev->minor, iobase); if (!request_region(iobase, DT2815_SIZE, "dt2815")) { printk("I/O port conflict\n"); return -EIO; diff --git a/comedi/drivers/dt2817.c b/comedi/drivers/dt2817.c index 9a86a62b..882938c4 100644 --- a/comedi/drivers/dt2817.c +++ b/comedi/drivers/dt2817.c @@ -127,10 +127,10 @@ static int dt2817_attach(comedi_device *dev,comedi_devconfig *it) { int ret; comedi_subdevice *s; - int iobase; + unsigned long iobase; iobase=it->options[0]; - printk("comedi%d: dt2817: 0x%04x ",dev->minor,iobase); + printk("comedi%d: dt2817: 0x%04lx ",dev->minor,iobase); if(!request_region(iobase,DT2817_SIZE,"dt2817")){ printk("I/O port conflict\n"); return -EIO; diff --git a/comedi/drivers/dt282x.c b/comedi/drivers/dt282x.c index 714a8f46..07679cbb 100644 --- a/comedi/drivers/dt282x.c +++ b/comedi/drivers/dt282x.c @@ -1210,14 +1210,14 @@ static int dt282x_attach(comedi_device * dev, comedi_devconfig * it) int i, irq; int ret; comedi_subdevice *s; - int iobase; + unsigned long iobase; dev->board_name = this_board->name; iobase = it->options[opt_iobase]; if(!iobase)iobase = 0x240; - printk("comedi%d: dt282x: 0x%04x", dev->minor, iobase); + printk("comedi%d: dt282x: 0x%04lx", dev->minor, iobase); if (!request_region(iobase, DT2821_SIZE, "dt282x")) { printk(" I/O port conflict\n"); return -EBUSY; @@ -1283,7 +1283,11 @@ static int dt282x_attach(comedi_device * dev, comedi_devconfig * it) } else if (irq == 0) { printk(" (no irq)"); } else { +#if 0 printk(" (probe returned multiple irqs--bad)"); +#else + printk(" (irq probe not implemented)"); +#endif } if((ret=alloc_private(dev,sizeof(dt282x_private)))<0) diff --git a/comedi/drivers/dt3000.c b/comedi/drivers/dt3000.c index 93cdb1d2..d45752a2 100644 --- a/comedi/drivers/dt3000.c +++ b/comedi/drivers/dt3000.c @@ -253,7 +253,7 @@ MODULE_DEVICE_TABLE(pci, dt3k_pci_table); typedef struct{ struct pci_dev *pci_dev; - unsigned long phys_addr; + resource_size_t phys_addr; void *io_addr; unsigned int lock; lsampl_t ao_readback[2]; @@ -785,7 +785,7 @@ static int dt3000_attach(comedi_device *dev,comedi_devconfig *it) if(comedi_request_irq(devpriv->pci_dev->irq, dt3k_interrupt, SA_SHIRQ, "dt3000", dev)){ - printk(" unable to allocate IRQ %d\n", devpriv->pci_dev->irq); + printk(" unable to allocate IRQ %u\n", devpriv->pci_dev->irq); return -EINVAL; } dev->irq = devpriv->pci_dev->irq; @@ -895,7 +895,7 @@ static int dt_pci_probe(comedi_device *dev) static int setup_pci(comedi_device *dev) { - u32 addr; + resource_size_t addr; int ret; ret = pci_enable_device(devpriv->pci_dev); @@ -909,7 +909,7 @@ static int setup_pci(comedi_device *dev) devpriv->io_addr = ioremap(devpriv->phys_addr, DT3000_SIZE); if(!devpriv->io_addr) return -ENOMEM; #if DEBUG - printk("0x%08lx mapped to %p, ",devpriv->phys_addr,devpriv->io_addr); + printk("0x%08llx mapped to %p, ",(unsigned long long)devpriv->phys_addr,devpriv->io_addr); #endif return 0; diff --git a/comedi/drivers/fl512.c b/comedi/drivers/fl512.c index a9555f4a..831f375e 100644 --- a/comedi/drivers/fl512.c +++ b/comedi/drivers/fl512.c @@ -75,7 +75,7 @@ static int fl512_ai_insn(comedi_device *dev, int n; unsigned int lo_byte, hi_byte; char chan = CR_CHAN(insn->chanspec); - int iobase = dev->iobase; + unsigned long iobase = dev->iobase; for(n=0; nn; n++) { /* sample n times on selected channel */ /* XXX probably can move next step out of for() loop -- will make @@ -101,7 +101,7 @@ static int fl512_ao_insn(comedi_device *dev, { int n; int chan = CR_CHAN(insn->chanspec); /* get chan to write */ - int iobase = dev->iobase; /* get base address */ + unsigned long iobase = dev->iobase; /* get base address */ for (n=0; nn; n++) { /* write n data set */ outb(data[n] & 0x0ff, iobase+4+2*chan); /* write low byte */ @@ -137,12 +137,12 @@ static int fl512_ao_insn_readback(comedi_device *dev, */ static int fl512_attach(comedi_device *dev,comedi_devconfig *it) { - int iobase; + unsigned long iobase; comedi_subdevice *s; /* pointer to the subdevice: Analog in, Analog out, ( not made ->and Digital IO) */ iobase = it->options[0]; - printk("comedi:%d fl512: 0x%04x",dev->minor,iobase); + printk("comedi:%d fl512: 0x%04lx",dev->minor,iobase); if (!request_region(iobase, FL512_SIZE, "fl512")) { printk(" I/O port conflict\n"); return -EIO; diff --git a/comedi/drivers/gsc_hpdi.c b/comedi/drivers/gsc_hpdi.c index 0f948813..09ba92c6 100644 --- a/comedi/drivers/gsc_hpdi.c +++ b/comedi/drivers/gsc_hpdi.c @@ -306,8 +306,8 @@ typedef struct { struct pci_dev *hw_dev; // pointer to board's pci_dev struct // base addresses (physical) - unsigned long plx9080_phys_iobase; - unsigned long hpdi_phys_iobase; + resource_size_t plx9080_phys_iobase; + resource_size_t hpdi_phys_iobase; // base addresses (ioremapped) void *plx9080_iobase; void *hpdi_iobase; @@ -606,19 +606,19 @@ static int hpdi_attach(comedi_device *dev, comedi_devconfig *it) return -ENOMEM; } - DEBUG_PRINT(" plx9080 remapped to 0x%lx\n", priv(dev)->plx9080_iobase); - DEBUG_PRINT(" hpdi remapped to 0x%lx\n", priv(dev)->hpdi_iobase); + DEBUG_PRINT(" plx9080 remapped to 0x%p\n", priv(dev)->plx9080_iobase); + DEBUG_PRINT(" hpdi remapped to 0x%p\n", priv(dev)->hpdi_iobase); // get irq if( comedi_request_irq( pcidev->irq, handle_interrupt, SA_SHIRQ, driver_hpdi.driver_name, dev ) ) { - printk( " unable to allocate irq %d\n", pcidev->irq ); + printk( " unable to allocate irq %u\n", pcidev->irq ); return -EINVAL; } dev->irq = pcidev->irq; - printk(" irq %i\n", dev->irq); + printk(" irq %u\n", dev->irq); init_plx9080(dev); diff --git a/comedi/drivers/icp_multi.c b/comedi/drivers/icp_multi.c index 20376420..aa91014a 100644 --- a/comedi/drivers/icp_multi.c +++ b/comedi/drivers/icp_multi.c @@ -194,7 +194,7 @@ typedef struct{ struct pcilst_struct *card; // pointer to card char valid; // card is usable void *io_addr; // Pointer to mapped io address - unsigned long phys_iobase; // Physical io address + resource_size_t phys_iobase; // Physical io address unsigned int AdcCmdStatus; // ADC Command/Status register unsigned int DacCmdStatus; // DAC Command/Status register unsigned int IntEnable; // Interrupt Enable register @@ -862,9 +862,10 @@ static int icp_multi_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; int ret, subdev, n_subdevices; - unsigned short master,irq; + unsigned short master; + unsigned int irq; struct pcilst_struct *card=NULL; - unsigned long io_addr[5], iobase; + resource_size_t io_addr[5], iobase; unsigned char pci_bus, pci_slot, pci_func; printk("icp_multi EDBG: BGN: icp_multi_attach(...)\n"); @@ -899,7 +900,8 @@ static int icp_multi_attach(comedi_device *dev,comedi_devconfig *it) iobase=io_addr[2]; devpriv->phys_iobase = iobase; - printk(", b:s:f=%d:%d:%d, io=0x%8lx \n", pci_bus, pci_slot, pci_func, iobase); + printk(", b:s:f=%d:%d:%d, io=0x%8llx \n", pci_bus, pci_slot, pci_func, + (unsigned long long)iobase); devpriv->io_addr = ioremap(iobase, ICP_MULTI_SIZE); @@ -909,7 +911,7 @@ static int icp_multi_attach(comedi_device *dev,comedi_devconfig *it) } #ifdef ICP_MULTI_EXTDEBUG - printk("0x%08lx mapped to %p, ", iobase, devpriv->io_addr); + printk("0x%08llx mapped to %p, ", (unsigned long long)iobase, devpriv->io_addr); #endif dev->board_name = this_board->name; @@ -928,11 +930,11 @@ static int icp_multi_attach(comedi_device *dev,comedi_devconfig *it) if (this_board->have_irq) { if (irq) { if (comedi_request_irq(irq, interrupt_service_icp_multi, SA_SHIRQ, "Inova Icp Multi", dev)) { - printk(", unable to allocate IRQ %d, DISABLING IT", irq); + printk(", unable to allocate IRQ %u, DISABLING IT", irq); irq=0; /* Can't use IRQ */ } else - printk(", irq=%d", irq); + printk(", irq=%u", irq); } else printk(", IRQ disabled"); diff --git a/comedi/drivers/icp_multi.h b/comedi/drivers/icp_multi.h index 6086da96..0472b15f 100644 --- a/comedi/drivers/icp_multi.h +++ b/comedi/drivers/icp_multi.h @@ -27,7 +27,7 @@ struct pcilst_struct{ unsigned char pci_bus; unsigned char pci_slot; unsigned char pci_func; - unsigned long io_addr[5]; + resource_size_t io_addr[5]; unsigned int irq; }; @@ -46,7 +46,7 @@ static int pci_card_free(struct pcilst_struct *amcc); static void pci_card_list_display(void); static int pci_card_data(struct pcilst_struct *amcc, unsigned char *pci_bus, unsigned char *pci_slot, unsigned char *pci_func, - unsigned long *io_addr, unsigned short *irq, unsigned short *master); + resource_size_t *io_addr, unsigned int *irq, unsigned short *master); /****************************************************************************/ @@ -197,9 +197,9 @@ static void pci_card_list_display(void) for (inova=inova_devices; inova; inova=next) { next=inova->next; - printk("%2d %2d %2d 0x%4x 0x%4x %3s 0x%8lx 0x%8lx %2d %2d\n", + printk("%2d %2d %2d 0x%4x 0x%4x %3s 0x%8llx 0x%8llx %2u %2d\n", inova->pci_bus,inova->pci_slot,inova->pci_func,inova->vendor,inova->device,inova->master?"yes":"no", - inova->io_addr[0],inova->io_addr[2],inova->irq,inova->used); + (unsigned long long)inova->io_addr[0],(unsigned long long)inova->io_addr[2],inova->irq,inova->used); } } @@ -208,7 +208,7 @@ static void pci_card_list_display(void) /* return all card information for driver */ static int pci_card_data(struct pcilst_struct *inova, unsigned char *pci_bus, unsigned char *pci_slot, unsigned char *pci_func, - unsigned long *io_addr, unsigned short *irq, unsigned short *master) + resource_size_t *io_addr, unsigned int *irq, unsigned short *master) { int i; diff --git a/comedi/drivers/ke_counter.c b/comedi/drivers/ke_counter.c index 47aa95d3..f8c7a8e8 100644 --- a/comedi/drivers/ke_counter.c +++ b/comedi/drivers/ke_counter.c @@ -145,7 +145,7 @@ static int cnt_attach(comedi_device *dev, comedi_devconfig *it) comedi_subdevice *subdevice; struct pci_dev *pci_device; cnt_board_struct *board; - int io_base; + unsigned long io_base; int error, i; /* allocate device private structure */ @@ -206,7 +206,7 @@ found: /* read register base address [PCI_BASE_ADDRESS #0] */ io_base = pci_resource_start(pci_device, 0); - dev->iobase = io_base & PCI_BASE_ADDRESS_IO_MASK; + dev->iobase = io_base; /* allocate the subdevice structures */ if((error = alloc_subdevices(dev, 1)) < 0) diff --git a/comedi/drivers/me4000.h b/comedi/drivers/me4000.h index 2b66e0b6..fc6aba45 100644 --- a/comedi/drivers/me4000.h +++ b/comedi/drivers/me4000.h @@ -449,7 +449,7 @@ typedef struct me4000_info { struct pci_dev *pci_dev_p; // General PCI information - char irq; // IRQ assigned from the PCI BIOS + unsigned int irq; // IRQ assigned from the PCI BIOS struct me4000_ai_context ai_context; // Analog input specific context struct me4000_ao_context ao_context[4]; // Vector with analog output specific context diff --git a/comedi/drivers/me_daq.c b/comedi/drivers/me_daq.c index b841a71e..195971cd 100644 --- a/comedi/drivers/me_daq.c +++ b/comedi/drivers/me_daq.c @@ -270,8 +270,8 @@ typedef struct struct pci_dev* pci_device; void *plx_regbase; // PLX configuration base address void *me_regbase; // Base address of the Meilhaus card - unsigned int plx_regbase_size; // Size of PLX configuration space - unsigned int me_regbase_size; // Size of Meilhaus space + unsigned long plx_regbase_size; // Size of PLX configuration space + unsigned long me_regbase_size; // Size of Meilhaus space unsigned short control_1; // Mirror of CONTROL_1 register unsigned short control_2; // Mirror of CONTROL_2 register @@ -679,13 +679,13 @@ static int me_attach(comedi_device *dev,comedi_devconfig *it) struct pci_dev* pci_device; comedi_subdevice *subdevice; me_board_struct* board; - unsigned int plx_regbase_tmp; - unsigned int plx_regbase_size_tmp; - unsigned int me_regbase_tmp; - unsigned int me_regbase_size_tmp; - unsigned int swap_regbase_tmp; - unsigned int swap_regbase_size_tmp; - unsigned int regbase_tmp; + resource_size_t plx_regbase_tmp; + unsigned long plx_regbase_size_tmp; + resource_size_t me_regbase_tmp; + unsigned long me_regbase_size_tmp; + resource_size_t swap_regbase_tmp; + unsigned long swap_regbase_size_tmp; + resource_size_t regbase_tmp; int result, error, i; // Allocate private memory @@ -757,7 +757,7 @@ found: // Read PLX register base address [PCI_BASE_ADDRESS #0]. plx_regbase_tmp = pci_resource_start(pci_device, 0); - plx_regbase_size_tmp = pci_resource_end(pci_device, 0) - plx_regbase_tmp + 1; + plx_regbase_size_tmp = pci_resource_len(pci_device, 0); dev_private->plx_regbase = ioremap(plx_regbase_tmp, plx_regbase_size_tmp); dev_private->plx_regbase_size = plx_regbase_size_tmp; if(!dev_private->plx_regbase) @@ -769,7 +769,7 @@ found: // Read Swap base address [PCI_BASE_ADDRESS #5]. swap_regbase_tmp = pci_resource_start(pci_device, 5); - swap_regbase_size_tmp = pci_resource_end(pci_device, 5) - swap_regbase_tmp + 1; + swap_regbase_size_tmp = pci_resource_len(pci_device, 5); if(!swap_regbase_tmp) { @@ -809,7 +809,7 @@ found: // Read Meilhaus register base address [PCI_BASE_ADDRESS #2]. me_regbase_tmp = pci_resource_start(pci_device, 2); - me_regbase_size_tmp = pci_resource_end(pci_device, 2) - me_regbase_tmp + 1; + me_regbase_size_tmp = pci_resource_len(pci_device, 2); dev_private->me_regbase_size = me_regbase_size_tmp; dev_private->me_regbase = ioremap(me_regbase_tmp, me_regbase_size_tmp); if(!dev_private->me_regbase) diff --git a/comedi/drivers/mite.c b/comedi/drivers/mite.c index 500e6484..834ff715 100644 --- a/comedi/drivers/mite.c +++ b/comedi/drivers/mite.c @@ -105,7 +105,7 @@ static void dump_chip_signature(u32 csigr_bits) int mite_setup(struct mite_struct *mite) { unsigned long length; - u32 addr; + resource_size_t addr; int i; u32 csigr_bits; @@ -126,7 +126,7 @@ int mite_setup(struct mite_struct *mite) printk("failed to remap mite io memory address\n"); return -ENOMEM; } - printk("MITE:0x%08lx mapped to %p ",mite->mite_phys_addr,mite->mite_io_addr); + printk("MITE:0x%08llx mapped to %p ",(unsigned long long)mite->mite_phys_addr,mite->mite_io_addr); addr=pci_resource_start(mite->pcidev, 1); mite->daq_phys_addr=addr; @@ -142,7 +142,7 @@ int mite_setup(struct mite_struct *mite) printk("failed to remap daq io memory address\n"); return -ENOMEM; } - printk("DAQ:0x%08lx mapped to %p\n",mite->daq_phys_addr,mite->daq_io_addr); + printk("DAQ:0x%08llx mapped to %p\n",(unsigned long long)mite->daq_phys_addr,mite->daq_io_addr); // The 6602 board needs different initalisation, see the // _updated_ (nov 2002) reg. Level Manual (filename 370505b.pdf) p. 3.55 diff --git a/comedi/drivers/mite.h b/comedi/drivers/mite.h index 44cfe44c..db7759a0 100644 --- a/comedi/drivers/mite.h +++ b/comedi/drivers/mite.h @@ -63,9 +63,9 @@ struct mite_struct{ int used; struct pci_dev *pcidev; - unsigned long mite_phys_addr; + resource_size_t mite_phys_addr; void *mite_io_addr; - unsigned long daq_phys_addr; + resource_size_t daq_phys_addr; void *daq_io_addr; struct mite_channel channels[MAX_MITE_DMA_CHANNELS]; diff --git a/comedi/drivers/mpc624.c b/comedi/drivers/mpc624.c index 0f28f6b1..b21e67d6 100644 --- a/comedi/drivers/mpc624.c +++ b/comedi/drivers/mpc624.c @@ -163,10 +163,10 @@ static int mpc624_ai_rinsn(comedi_device *dev, comedi_subdevice *s, comedi_insn static int mpc624_attach(comedi_device *dev, comedi_devconfig *it) { comedi_subdevice *s; - int iobase; + unsigned long iobase; iobase = it->options[0]; - rt_printk("comedi%d: mpc624 [0x%04x, ", dev->minor, iobase); + rt_printk("comedi%d: mpc624 [0x%04lx, ", dev->minor, iobase); if(request_region(iobase, MPC624_SIZE, "mpc624") == NULL) { rt_printk("I/O port(s) in use\n"); diff --git a/comedi/drivers/multiq3.c b/comedi/drivers/multiq3.c index a8beb7b1..6f326147 100644 --- a/comedi/drivers/multiq3.c +++ b/comedi/drivers/multiq3.c @@ -231,12 +231,12 @@ static void encoder_reset(comedi_device *dev) { static int multiq3_attach(comedi_device * dev, comedi_devconfig * it) { int result = 0; - int iobase; - int irq; + unsigned long iobase; + unsigned int irq; comedi_subdevice *s; iobase = it->options[0]; - printk("comedi%d: multiq3: 0x%04x ", dev->minor, iobase); + printk("comedi%d: multiq3: 0x%04lx ", dev->minor, iobase); if (!request_region(iobase, MULTIQ3_SIZE, "multiq3")) { printk("comedi%d: I/O port conflict\n", dev->minor); return -EIO; @@ -245,9 +245,9 @@ static int multiq3_attach(comedi_device * dev, comedi_devconfig * it) dev->iobase = iobase; irq = it->options[1]; - if (irq > 0) { - printk("comedi%d: irq = %d ignored\n", dev->minor, irq); - } else if(irq == 0) { + if (irq) { + printk("comedi%d: irq = %u ignored\n", dev->minor, irq); + } else { printk("comedi%d: no irq\n", dev->minor); } dev->board_name = "multiq3"; diff --git a/comedi/drivers/ni_at_a2150.c b/comedi/drivers/ni_at_a2150.c index 95e12c15..23776be3 100644 --- a/comedi/drivers/ni_at_a2150.c +++ b/comedi/drivers/ni_at_a2150.c @@ -331,23 +331,23 @@ static int a2150_probe(comedi_device *dev) static int a2150_attach(comedi_device *dev, comedi_devconfig *it) { comedi_subdevice *s; - int iobase = it->options[0]; - int irq = it->options[1]; - int dma = it->options[2]; + unsigned long iobase = it->options[0]; + unsigned int irq = it->options[1]; + unsigned int dma = it->options[2]; static const int timeout = 2000; int i; - printk("comedi%d: %s: io 0x%x", dev->minor, driver_a2150.driver_name, iobase); + printk("comedi%d: %s: io 0x%lx", dev->minor, driver_a2150.driver_name, iobase); if(irq) { - printk(", irq %i", irq); + printk(", irq %u", irq); }else { printk(", no irq"); } if(dma) { - printk(", dma %i", dma); + printk(", dma %u", dma); }else { printk(", no dma"); @@ -378,12 +378,12 @@ static int a2150_attach(comedi_device *dev, comedi_devconfig *it) // check that irq is supported if(irq < 3 || irq == 8 || irq == 13 || irq > 15) { - printk(" invalid irq line\n"); + printk(" invalid irq line %u\n", irq); return -EINVAL; } if(comedi_request_irq( irq, a2150_interrupt, 0, driver_a2150.driver_name, dev )) { - printk( "unable to allocate irq %d\n", irq); + printk( "unable to allocate irq %u\n", irq); return -EINVAL; } devpriv->irq_dma_bits |= IRQ_LVL_BITS(irq); @@ -393,14 +393,14 @@ static int a2150_attach(comedi_device *dev, comedi_devconfig *it) // initialize dma if(dma) { - if(dma < 0 || dma == 4 || dma > 7) + if(dma == 4 || dma > 7) { - printk(" invalid dma channel %i\n", dma); + printk(" invalid dma channel %u\n", dma); return -EINVAL; } if(request_dma(dma, driver_a2150.driver_name)) { - printk(" failed to allocate dma channel %i\n", dma); + printk(" failed to allocate dma channel %u\n", dma); return -EINVAL; } devpriv->dma = dma; diff --git a/comedi/drivers/ni_atmio.c b/comedi/drivers/ni_atmio.c index fdcb870e..55f84148 100644 --- a/comedi/drivers/ni_atmio.c +++ b/comedi/drivers/ni_atmio.c @@ -395,9 +395,9 @@ static int ni_atmio_attach(comedi_device *dev,comedi_devconfig *it) { struct pnp_dev *isapnp_dev; int ret; - int iobase; + unsigned long iobase; int board; - int irq; + unsigned int irq; /* allocate private area */ if((ret = ni_alloc_private(dev)) < 0) @@ -421,7 +421,7 @@ static int ni_atmio_attach(comedi_device *dev,comedi_devconfig *it) /* reserve our I/O region */ - printk("comedi%d: ni_atmio: 0x%04x",dev->minor,iobase); + printk("comedi%d: ni_atmio: 0x%04lx",dev->minor,iobase); if(!request_region(iobase,NI_SIZE,"ni_atmio")){ printk(" I/O port conflict\n"); return -EIO; @@ -454,11 +454,11 @@ static int ni_atmio_attach(comedi_device *dev,comedi_devconfig *it) /* irq stuff */ if(irq!=0){ - if(irq<0 || irq>15 || ni_irqpin[irq]==-1){ - printk(" invalid irq\n"); + if(irq>15 || ni_irqpin[irq]==-1){ + printk(" invalid irq %u\n",irq); return -EINVAL; } - printk(" ( irq = %d )",irq); + printk(" ( irq = %u )",irq); if( (ret=comedi_request_irq(irq,ni_E_interrupt,NI_E_IRQ_FLAGS,"ni_atmio",dev))<0 ){ printk(" irq not available\n"); return -EINVAL; diff --git a/comedi/drivers/ni_atmio16d.c b/comedi/drivers/ni_atmio16d.c index 0dd3fc95..cb22c190 100644 --- a/comedi/drivers/ni_atmio16d.c +++ b/comedi/drivers/ni_atmio16d.c @@ -697,15 +697,15 @@ static int atmio16d_dio_insn_config(comedi_device *dev, comedi_subdevice *s, static int atmio16d_attach(comedi_device * dev, comedi_devconfig * it) { - int irq; - int iobase; + unsigned int irq; + unsigned long iobase; int ret; comedi_subdevice *s; /* make sure the address range is free and allocate it */ iobase = it->options[0]; - printk("comedi%d: atmio16d: 0x%04x ", dev->minor, iobase); + printk("comedi%d: atmio16d: 0x%04lx ", dev->minor, iobase); if (!request_region(iobase, ATMIO16D_SIZE, "ni_atmio16d")) { printk("I/O port conflict\n"); return -EIO; @@ -727,16 +727,16 @@ static int atmio16d_attach(comedi_device * dev, comedi_devconfig * it) /* check if our interrupt is available and get it */ irq=it->options[1]; - if(irq>0){ + if(irq){ if((ret=comedi_request_irq(irq,atmio16d_interrupt, 0, "atmio16d", dev))<0) { - printk("failed to allocate irq %d\n", irq); + printk("failed to allocate irq %u\n", irq); return ret; } dev->irq=irq; - printk("( irq = %d )\n",irq); - } else if(irq == 0){ + printk("( irq = %u )\n",irq); + } else { printk("( no irq )"); } @@ -819,7 +819,7 @@ static int atmio16d_attach(comedi_device * dev, comedi_devconfig * it) /* 8255 subdevice */ s++; if(boardtype->has_8255){ - subdev_8255_init(dev,s,NULL,(unsigned long)dev->iobase); + subdev_8255_init(dev,s,NULL,dev->iobase); }else{ s->type=COMEDI_SUBD_UNUSED; } diff --git a/comedi/drivers/ni_daq_dio24.c b/comedi/drivers/ni_daq_dio24.c index 46dabf05..1e480983 100644 --- a/comedi/drivers/ni_daq_dio24.c +++ b/comedi/drivers/ni_daq_dio24.c @@ -123,9 +123,9 @@ static comedi_driver driver_dio24={ static int dio24_attach(comedi_device *dev, comedi_devconfig *it) { comedi_subdevice *s; - int iobase = 0; + unsigned long iobase = 0; #ifdef incomplete - int irq = 0; + unsigned int irq = 0; #endif dev_link_t *link; @@ -149,11 +149,11 @@ static int dio24_attach(comedi_device *dev, comedi_devconfig *it) return -EINVAL; break; } - printk("comedi%d: ni_daq_dio24: %s, io 0x%x", dev->minor, thisboard->name, iobase); + printk("comedi%d: ni_daq_dio24: %s, io 0x%lx", dev->minor, thisboard->name, iobase); #ifdef incomplete if(irq) { - printk(", irq %i", irq); + printk(", irq %u", irq); } #endif @@ -169,11 +169,6 @@ static int dio24_attach(comedi_device *dev, comedi_devconfig *it) #ifdef incomplete /* grab our IRQ */ - if(irq < 0) - { - printk("irq out of range\n"); - return -EINVAL; - } dev->irq = irq; #endif diff --git a/comedi/drivers/ni_labpc.c b/comedi/drivers/ni_labpc.c index 494807bc..d6107240 100644 --- a/comedi/drivers/ni_labpc.c +++ b/comedi/drivers/ni_labpc.c @@ -466,7 +466,7 @@ static inline int labpc_counter_load(comedi_device *dev, unsigned long base_addr } int labpc_common_attach( comedi_device *dev, unsigned long iobase, - int irq, int dma_chan ) + unsigned int irq, unsigned int dma_chan ) { comedi_subdevice *s; int i; @@ -476,11 +476,11 @@ int labpc_common_attach( comedi_device *dev, unsigned long iobase, printk("comedi%d: ni_labpc: %s, io 0x%lx", dev->minor, thisboard->name, iobase); if(irq) { - printk(", irq %i", irq); + printk(", irq %u", irq); } if(dma_chan) { - printk(", dma %i", dma_chan); + printk(", dma %u", dma_chan); } printk("\n"); @@ -523,11 +523,6 @@ int labpc_common_attach( comedi_device *dev, unsigned long iobase, } /* grab our IRQ */ - if(irq < 0) - { - printk("irq out of range\n"); - return -EINVAL; - } if(irq) { isr_flags = 0; @@ -535,16 +530,16 @@ int labpc_common_attach( comedi_device *dev, unsigned long iobase, isr_flags |= SA_SHIRQ; if(comedi_request_irq( irq, labpc_interrupt, isr_flags, driver_labpc.driver_name, dev)) { - printk( "unable to allocate irq %d\n", irq); + printk( "unable to allocate irq %u\n", irq); return -EINVAL; } } dev->irq = irq; // grab dma channel - if(dma_chan < 0 || dma_chan > 3) + if(dma_chan > 3) { - printk(" invalid dma channel\n"); + printk(" invalid dma channel %u\n", dma_chan); return -EINVAL; }else if(dma_chan) { @@ -557,7 +552,7 @@ int labpc_common_attach( comedi_device *dev, unsigned long iobase, } if(request_dma(dma_chan, driver_labpc.driver_name)) { - printk(" failed to allocate dma channel %i\n", dma_chan); + printk(" failed to allocate dma channel %u\n", dma_chan); return -EINVAL; } devpriv->dma_chan = dma_chan; @@ -669,8 +664,8 @@ int labpc_common_attach( comedi_device *dev, unsigned long iobase, static int labpc_attach(comedi_device *dev, comedi_devconfig *it) { unsigned long iobase = 0; - int irq = 0; - int dma_chan = 0; + unsigned int irq = 0; + unsigned int dma_chan = 0; int ret; /* allocate and initialize dev->private */ diff --git a/comedi/drivers/ni_labpc.h b/comedi/drivers/ni_labpc.h index d977b23b..e2aa49ef 100644 --- a/comedi/drivers/ni_labpc.h +++ b/comedi/drivers/ni_labpc.h @@ -77,7 +77,7 @@ typedef struct{ extern labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS]; int labpc_common_attach( comedi_device *dev, unsigned long iobase, - int irq, int dma ); + unsigned int irq, unsigned int dma ); int labpc_common_detach( comedi_device *dev ); diff --git a/comedi/drivers/ni_labpc_cs.c b/comedi/drivers/ni_labpc_cs.c index 4e77b0cb..69ca7e6c 100644 --- a/comedi/drivers/ni_labpc_cs.c +++ b/comedi/drivers/ni_labpc_cs.c @@ -111,7 +111,7 @@ static comedi_driver driver_labpc_cs = static int labpc_attach(comedi_device *dev, comedi_devconfig *it) { unsigned long iobase = 0; - int irq = 0; + unsigned int irq = 0; dev_link_t *link; /* allocate and initialize dev->private */ diff --git a/comedi/drivers/ni_mio_cs.c b/comedi/drivers/ni_mio_cs.c index 97e01f85..ab124e16 100644 --- a/comedi/drivers/ni_mio_cs.c +++ b/comedi/drivers/ni_mio_cs.c @@ -451,7 +451,7 @@ static void mio_cs_config(dev_link_t *link) static int mio_cs_attach(comedi_device *dev,comedi_devconfig *it) { dev_link_t *link; - int irq; + unsigned int irq; int ret; DPRINTK("mio_cs_attach(dev=%p,it=%p)\n",dev,it); @@ -464,7 +464,7 @@ static int mio_cs_attach(comedi_device *dev,comedi_devconfig *it) irq=link->irq.AssignedIRQ; - printk("comedi%d: %s: DAQCard: io 0x%04lx, irq %d, ", + printk("comedi%d: %s: DAQCard: io 0x%04lx, irq %u, ", dev->minor,dev->driver->driver_name,dev->iobase, irq); diff --git a/comedi/drivers/ni_pcidio.c b/comedi/drivers/ni_pcidio.c index 8f891e92..cef06a3c 100644 --- a/comedi/drivers/ni_pcidio.c +++ b/comedi/drivers/ni_pcidio.c @@ -1064,7 +1064,7 @@ static int nidio_attach(comedi_device *dev,comedi_devconfig *it) int i; int ret; int n_subdevices; - int irq; + unsigned int irq; printk("comedi%d: nidio:",dev->minor); diff --git a/comedi/drivers/ni_pcimio.c b/comedi/drivers/ni_pcimio.c index 4598b333..be1df246 100644 --- a/comedi/drivers/ni_pcimio.c +++ b/comedi/drivers/ni_pcimio.c @@ -1365,7 +1365,7 @@ static int pcimio_attach(comedi_device *dev,comedi_devconfig *it) if(dev->irq==0){ printk(" unknown irq (bad)\n"); }else{ - printk(" ( irq = %d )",dev->irq); + printk(" ( irq = %u )",dev->irq); if( (ret=comedi_request_irq(dev->irq,ni_E_interrupt,NI_E_IRQ_FLAGS,"ni_pcimio",dev))<0 ){ printk(" irq not available\n"); dev->irq=0; diff --git a/comedi/drivers/pcl711.c b/comedi/drivers/pcl711.c index 6c05d029..5e69e45d 100644 --- a/comedi/drivers/pcl711.c +++ b/comedi/drivers/pcl711.c @@ -491,14 +491,14 @@ static int pcl711_detach(comedi_device * dev) static int pcl711_attach(comedi_device * dev, comedi_devconfig * it) { int ret; - int iobase; - int irq; + unsigned long iobase; + unsigned int irq; comedi_subdevice *s; /* claim our I/O space */ iobase = it->options[0]; - printk("comedi%d: pcl711: 0x%04x ", dev->minor, iobase); + printk("comedi%d: pcl711: 0x%04lx ", dev->minor, iobase); if (!request_region(iobase, PCL711_SIZE, "pcl711")) { printk("I/O port conflict\n"); return -EIO; @@ -512,16 +512,16 @@ static int pcl711_attach(comedi_device * dev, comedi_devconfig * it) /* grab our IRQ */ irq = it->options[1]; - if (irq < 0 || irq > this_board->maxirq) { + if (irq > this_board->maxirq) { printk("irq out of range\n"); return -EINVAL; } if (irq) { if (comedi_request_irq(irq, pcl711_interrupt, 0, "pcl711", dev)) { - printk("unable to allocate irq %d\n", irq); + printk("unable to allocate irq %u\n", irq); return -EINVAL; } else { - printk("( irq = %d )\n", irq); + printk("( irq = %u )\n", irq); } } dev->irq = irq; diff --git a/comedi/drivers/pcl724.c b/comedi/drivers/pcl724.c index 28bf8d61..5de96dc1 100644 --- a/comedi/drivers/pcl724.c +++ b/comedi/drivers/pcl724.c @@ -64,7 +64,7 @@ typedef struct { int dio; // num of DIO int numofports; // num of 8255 subdevices unsigned int IRQbits; // allowed interrupts - int io_range; // len of IO space + unsigned int io_range; // len of IO space char can_have96; char is_pet48; } boardtype; @@ -96,7 +96,7 @@ COMEDI_INITCLEANUP(driver_pcl724); static int subdev_8255_cb(int dir,int port,int data,unsigned long arg) { - int iobase=arg; + unsigned long iobase=arg; if(dir){ outb(data,iobase+port); @@ -124,14 +124,18 @@ static int subdev_8255mapped_cb(int dir,int port,int data,unsigned long iobase) static int pcl724_attach(comedi_device *dev,comedi_devconfig *it) { - int iobase,iorange; + unsigned long iobase; + unsigned int iorange; int ret,i,n_subdevices; +#ifdef PCL724_IRQ + unsigned int irq; +#endif iobase=it->options[0]; iorange=this_board->io_range; if ((this_board->can_have96)&&((it->options[1]==1)||(it->options[1]==96))) iorange=PCL722_96_SIZE; // PCL-724 in 96 DIO configuration - printk("comedi%d: pcl724: board=%s, 0x%03x ",dev->minor, + printk("comedi%d: pcl724: board=%s, 0x%03lx ",dev->minor, this_board->name,iobase); if(!request_region(iobase, iorange, "pcl724")){ printk("I/O port conflict\n"); @@ -146,16 +150,16 @@ static int pcl724_attach(comedi_device *dev,comedi_devconfig *it) irq=0; if (this_board->IRQbits!=0) { /* board support IRQ */ irq=it->options[1]; - if (irq>0) {/* we want to use IRQ */ + if (irq) {/* we want to use IRQ */ if (((1<IRQbits)==0) { - rt_printk(", IRQ %d is out of allowed range, DISABLING IT",irq); + rt_printk(", IRQ %u is out of allowed range, DISABLING IT",irq); irq=0; /* Bad IRQ */ } else { if (comedi_request_irq(irq, interrupt_pcl724, 0, "pcl724", dev)) { - rt_printk(", unable to allocate IRQ %d, DISABLING IT", irq); + rt_printk(", unable to allocate IRQ %u, DISABLING IT", irq); irq=0; /* Can't use IRQ */ } else { - rt_printk(", irq=%d", irq); + rt_printk(", irq=%u", irq); } } } diff --git a/comedi/drivers/pcl725.c b/comedi/drivers/pcl725.c index a9d29b3e..578299ad 100644 --- a/comedi/drivers/pcl725.c +++ b/comedi/drivers/pcl725.c @@ -60,10 +60,10 @@ static int pcl725_di_insn(comedi_device *dev,comedi_subdevice *s, static int pcl725_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; - int iobase; + unsigned long iobase; iobase=it->options[0]; - printk("comedi%d: pcl725: 0x%04x ",dev->minor,iobase); + printk("comedi%d: pcl725: 0x%04lx ",dev->minor,iobase); if(!request_region(iobase,PCL725_SIZE,"pcl725")){ printk("I/O port conflict\n"); return -EIO; diff --git a/comedi/drivers/pcl726.c b/comedi/drivers/pcl726.c index 2f15431e..b7cd7040 100644 --- a/comedi/drivers/pcl726.c +++ b/comedi/drivers/pcl726.c @@ -121,7 +121,7 @@ typedef struct { int n_aochan; // num of D/A chans int num_of_ranges; // num of ranges unsigned int IRQbits; // allowed interrupts - int io_range; // len of IO space + unsigned int io_range; // len of IO space char have_dio; // 1=card have DI/DO ports int di_hi; // ports for DI/DO operations int di_lo; @@ -239,12 +239,16 @@ static int pcl726_do_insn_bits(comedi_device *dev,comedi_subdevice *s, static int pcl726_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; - int iobase,iorange; + unsigned long iobase; + unsigned int iorange; int ret,i; +#ifdef ACL6126_IRQ + unsigned int irq; +#endif iobase=it->options[0]; iorange=this_board->io_range; - printk("comedi%d: pcl726: board=%s, 0x%03x ",dev->minor,this_board->name,iobase); + printk("comedi%d: pcl726: board=%s, 0x%03lx ",dev->minor,this_board->name,iobase); if(!request_region(iobase, iorange, "pcl726")){ printk("I/O port conflict\n"); return -EIO; @@ -267,7 +271,7 @@ static int pcl726_attach(comedi_device *dev,comedi_devconfig *it) if (boardtypes[board].IRQbits!=0) { /* board support IRQ */ irq=it->options[1]; devpriv->first_chan=2; - if (irq>0) {/* we want to use IRQ */ + if (irq) {/* we want to use IRQ */ if (((1<options[0]; iorange=this_board->io_range; - printk("comedi%d: pcl730: board=%s 0x%04x ", dev->minor, + printk("comedi%d: pcl730: board=%s 0x%04lx ", dev->minor, this_board->name, iobase); if( !request_region(iobase, iorange, "pcl730") ) { printk("I/O port conflict\n"); diff --git a/comedi/drivers/pcl812.c b/comedi/drivers/pcl812.c index a463f1f0..384d4531 100644 --- a/comedi/drivers/pcl812.c +++ b/comedi/drivers/pcl812.c @@ -1172,15 +1172,15 @@ static void pcl812_reset(comedi_device * dev) static int pcl812_attach(comedi_device * dev, comedi_devconfig * it) { int ret,subdev; - int iobase; - int irq; - int dma; + unsigned long iobase; + unsigned int irq; + unsigned int dma; unsigned long pages; comedi_subdevice *s; int n_subdevices; iobase = it->options[0]; - printk("comedi%d: pcl812: board=%s, ioport=0x%03x", dev->minor, + printk("comedi%d: pcl812: board=%s, ioport=0x%03lx", dev->minor, this_board->name, iobase); if (!request_region(iobase, this_board->io_range, "pcl812")) { @@ -1201,14 +1201,14 @@ static int pcl812_attach(comedi_device * dev, comedi_devconfig * it) irq = it->options[1]; if (irq) { /* we want to use IRQ */ if (((1 << irq) & this_board->IRQbits) == 0) { - printk(", IRQ %d is out of allowed range, DISABLING IT", irq); + printk(", IRQ %u is out of allowed range, DISABLING IT", irq); irq = 0; /* Bad IRQ */ } else { if (comedi_request_irq(irq, interrupt_pcl812, 0, "pcl812", dev)) { - printk(", unable to allocate IRQ %d, DISABLING IT", irq); + printk(", unable to allocate IRQ %u, DISABLING IT", irq); irq = 0; /* Can't use IRQ */ } else { - printk(", irq=%d", irq); + printk(", irq=%u", irq); } } } @@ -1228,11 +1228,11 @@ static int pcl812_attach(comedi_device * dev, comedi_devconfig * it) } ret = request_dma(dma, "pcl812"); if (ret) { - printk(", unable to allocate DMA %d, FAIL!\n", dma); + printk(", unable to allocate DMA %u, FAIL!\n", dma); return -EBUSY; /* DMA isn't free */ } devpriv->dma = dma; - printk(", dma=%d", dma); + printk(", dma=%u", dma); pages = 1; /* we want 8KB */ devpriv->dmabuf[0] = __get_dma_pages(GFP_KERNEL, pages); if (!devpriv->dmabuf[0]) { diff --git a/comedi/drivers/pcl816.c b/comedi/drivers/pcl816.c index 7665821b..1410f4a5 100644 --- a/comedi/drivers/pcl816.c +++ b/comedi/drivers/pcl816.c @@ -114,7 +114,7 @@ typedef struct { int n_dochan; // num of DO chans comedi_lrange *ai_range_type; // default A/D rangelist comedi_lrange *ao_range_type; // dafault D/A rangelist - int io_range; // len of IO space + unsigned int io_range; // len of IO space unsigned int IRQbits; // allowed interrupts unsigned int DMAbits; // allowed DMA chans int ai_maxdata; // maxdata for A/D @@ -172,10 +172,10 @@ COMEDI_INITCLEANUP(driver_pcl816); typedef struct { - int dma; // used DMA, 0=don't use DMA + unsigned int dma; // used DMA, 0=don't use DMA int dma_rtc; // 1=RTC used with DMA, 0=no RTC alloc #ifdef unused - unsigned int rtc_iobase; // RTC port region + unsigned long rtc_iobase; // RTC port region unsigned int rtc_iosize; unsigned int rtc_irq; #endif @@ -793,7 +793,7 @@ pcl816_ai_cancel (comedi_device * dev, comedi_subdevice * s) ============================================================================== chech for PCL816 */ -static int pcl816_check (int iobase) +static int pcl816_check (unsigned long iobase) { outb (0x00, iobase + PCL816_MUX); comedi_udelay (1); @@ -1013,15 +1013,15 @@ static int pcl816_attach (comedi_device * dev, comedi_devconfig * it) { int ret; - int iobase; - int irq, dma; + unsigned long iobase; + unsigned int irq, dma; unsigned long pages; //int i; comedi_subdevice *s; /* claim our I/O space */ iobase = it->options[0]; - printk("comedi%d: pcl816: board=%s, ioport=0x%03x", dev->minor, + printk("comedi%d: pcl816: board=%s, ioport=0x%03lx", dev->minor, this_board->name, iobase); if (!request_region (iobase, this_board->io_range, "pcl816")) { @@ -1046,21 +1046,21 @@ pcl816_attach (comedi_device * dev, comedi_devconfig * it) irq = 0; if (this_board->IRQbits != 0) { /* board support IRQ */ irq = it->options[1]; - if (irq > 0) + if (irq) { /* we want to use IRQ */ if (((1 << irq) & this_board->IRQbits) == 0) { - rt_printk (", IRQ %d is out of allowed range, DISABLING IT", irq); + rt_printk (", IRQ %u is out of allowed range, DISABLING IT", irq); irq = 0; /* Bad IRQ */ } else { if (comedi_request_irq(irq, interrupt_pcl816, 0, "pcl816", dev)) { - rt_printk (", unable to allocate IRQ %d, DISABLING IT",irq); + rt_printk (", unable to allocate IRQ %u, DISABLING IT",irq); irq = 0; /* Can't use IRQ */ } else { - rt_printk (", irq=%d", irq); + rt_printk (", irq=%u", irq); } } } @@ -1094,7 +1094,7 @@ pcl816_attach (comedi_device * dev, comedi_devconfig * it) 0, "pcl816 DMA (RTC)", dev)) { devpriv->dma_rtc = 1; devpriv->rtc_irq = RTC_IRQ; - rt_printk (", dma_irq=%d", devpriv->rtc_irq); + rt_printk (", dma_irq=%u", devpriv->rtc_irq); } else { RTC_lock--; if (RTC_lock == 0) @@ -1130,12 +1130,12 @@ no_rtc: } ret = request_dma (dma, "pcl816"); if (ret) { - rt_printk (", unable to allocate DMA %d, FAIL!\n", dma); + rt_printk (", unable to allocate DMA %u, FAIL!\n", dma); return -EBUSY; /* DMA isn't free */ } devpriv->dma = dma; - rt_printk (", dma=%d", dma); + rt_printk (", dma=%u", dma); pages = 2; /* we need 16KB */ devpriv->dmabuf[0] = __get_dma_pages (GFP_KERNEL, pages); diff --git a/comedi/drivers/pcl818.c b/comedi/drivers/pcl818.c index 6c211801..7b73999b 100644 --- a/comedi/drivers/pcl818.c +++ b/comedi/drivers/pcl818.c @@ -259,7 +259,7 @@ typedef struct { int n_dochan; // num of DO chans comedi_lrange *ai_range_type; // default A/D rangelist comedi_lrange *ao_range_type; // default D/A rangelist - int io_range; // len of IO space + unsigned int io_range; // len of IO space unsigned int IRQbits; // allowed interrupts unsigned int DMAbits; // allowed DMA chans int ai_maxdata; // maxdata for A/D @@ -302,11 +302,11 @@ COMEDI_INITCLEANUP(driver_pcl818); typedef struct { - int dma; // used DMA, 0=don't use DMA + unsigned int dma; // used DMA, 0=don't use DMA int dma_rtc; // 1=RTC used with DMA, 0=no RTC alloc - int io_range; + unsigned int io_range; #ifdef unused - unsigned int rtc_iobase; // RTC port region + unsigned long rtc_iobase; // RTC port region unsigned int rtc_iosize; unsigned int rtc_irq; struct timer_list rtc_irq_timer;// timer for RTC sanity check @@ -1412,7 +1412,7 @@ static int pcl818_ai_cancel(comedi_device * dev, comedi_subdevice * s) ============================================================================== chech for PCL818 */ -static int pcl818_check(int iobase) +static int pcl818_check(unsigned long iobase) { outb(0x00, iobase + PCL818_MUX); comedi_udelay(1); @@ -1579,8 +1579,8 @@ static void free_resources(comedi_device * dev) static int pcl818_attach(comedi_device * dev, comedi_devconfig * it) { int ret; - int iobase; - int irq,dma; + unsigned long iobase; + unsigned int irq,dma; unsigned long pages; comedi_subdevice *s; @@ -1590,7 +1590,7 @@ static int pcl818_attach(comedi_device * dev, comedi_devconfig * it) /* claim our I/O space */ iobase = it->options[0]; - printk("comedi%d: pcl818: board=%s, ioport=0x%03x", + printk("comedi%d: pcl818: board=%s, ioport=0x%03lx", dev->minor, this_board->name, iobase); devpriv->io_range=this_board->io_range; if ((this_board->fifo)&&(it->options[2]==-1)) { // we've board with FIFO and we want to use FIFO @@ -1615,16 +1615,16 @@ static int pcl818_attach(comedi_device * dev, comedi_devconfig * it) irq=0; if (this_board->IRQbits!=0) { /* board support IRQ */ irq=it->options[1]; - if (irq>0) {/* we want to use IRQ */ + if (irq) {/* we want to use IRQ */ if (((1<IRQbits)==0) { - rt_printk(", IRQ %d is out of allowed range, DISABLING IT",irq); + rt_printk(", IRQ %u is out of allowed range, DISABLING IT",irq); irq=0; /* Bad IRQ */ } else { if (comedi_request_irq(irq, interrupt_pcl818, 0, "pcl818", dev)) { - rt_printk(", unable to allocate IRQ %d, DISABLING IT", irq); + rt_printk(", unable to allocate IRQ %u, DISABLING IT", irq); irq=0; /* Can't use IRQ */ } else { - rt_printk(", irq=%d", irq); + rt_printk(", irq=%u", irq); } } } @@ -1650,7 +1650,7 @@ static int pcl818_attach(comedi_device * dev, comedi_devconfig * it) if (!comedi_request_irq(RTC_IRQ, interrupt_pcl818_ai_mode13_dma_rtc, 0, "pcl818 DMA (RTC)", dev)) { devpriv->dma_rtc=1; devpriv->rtc_irq=RTC_IRQ; - rt_printk(", dma_irq=%d", devpriv->rtc_irq); + rt_printk(", dma_irq=%u", devpriv->rtc_irq); } else { RTC_lock--; if (RTC_lock==0) { @@ -1676,11 +1676,11 @@ no_rtc: } ret=request_dma(dma, "pcl818"); if (ret) { - rt_printk(", unable to allocate DMA %d, FAIL!\n",dma); + rt_printk(", unable to allocate DMA %u, FAIL!\n",dma); return -EBUSY; /* DMA isn't free */ } devpriv->dma=dma; - rt_printk(", dma=%d", dma); + rt_printk(", dma=%u", dma); pages=2; /* we need 16KB */ devpriv->dmabuf[0]=__get_dma_pages(GFP_KERNEL, pages); if (!devpriv->dmabuf[0]) { diff --git a/comedi/drivers/pcm3724.c b/comedi/drivers/pcm3724.c index f4f66449..df738aba 100644 --- a/comedi/drivers/pcm3724.c +++ b/comedi/drivers/pcm3724.c @@ -70,7 +70,7 @@ typedef struct { int dio; // num of DIO int numofports; // num of 8255 subdevices unsigned int IRQbits; // allowed interrupts - int io_range; // len of IO space + unsigned int io_range; // len of IO space } boardtype; //used to track configured dios @@ -101,16 +101,16 @@ COMEDI_INITCLEANUP(driver_pcm3724); static int subdev_8255_cb(int dir,int port,int data,unsigned long arg) { - int iobase=arg; + unsigned long iobase=arg; unsigned char inbres; - //printk("8255cb %d %d %d %x\n", dir,port,data,arg); + //printk("8255cb %d %d %d %lx\n", dir,port,data,arg); if(dir){ - //printk("8255 cb outb(%x, %x)\n", data, iobase+port); + //printk("8255 cb outb(%x, %lx)\n", data, iobase+port); outb(data,iobase+port); return 0; }else{ inbres = inb(iobase+port); - //printk("8255 cb inb(%x) = %x\n", iobase+port, inbres); + //printk("8255 cb inb(%lx) = %x\n", iobase+port, inbres); return inbres; } } @@ -150,7 +150,7 @@ static void do_3724_config(comedi_device *dev,comedi_subdevice *s, { int config; int buffer_config; - int port_8255_cfg; + unsigned long port_8255_cfg; config=CR_CW; buffer_config = 0; @@ -176,7 +176,7 @@ static void do_3724_config(comedi_device *dev,comedi_subdevice *s, port_8255_cfg = dev->iobase + SIZE_8255 + _8255_CR; } outb(buffer_config, dev->iobase + 8); /* update buffer register */ - //printk("pcm3724 buffer_config (%x) %d, %x\n", dev->iobase + _8255_CR, chanspec, buffer_config); + //printk("pcm3724 buffer_config (%lx) %d, %x\n", dev->iobase + _8255_CR, chanspec, buffer_config); outb(config, port_8255_cfg); } @@ -259,7 +259,8 @@ static int subdev_3724_insn_config(comedi_device *dev, comedi_subdevice *s, static int pcm3724_attach(comedi_device *dev,comedi_devconfig *it) { - int iobase,iorange; + unsigned long iobase; + unsigned int iorange; int ret,i,n_subdevices; iobase=it->options[0]; @@ -270,7 +271,7 @@ static int pcm3724_attach(comedi_device *dev,comedi_devconfig *it) ((priv_pcm3724*)(dev->private))->dio_1 = 0; ((priv_pcm3724*)(dev->private))->dio_2 = 0; - printk("comedi%d: pcm3724: board=%s, 0x%03x ",dev->minor, + printk("comedi%d: pcm3724: board=%s, 0x%03lx ",dev->minor, this_board->name,iobase); if(!iobase || !request_region(iobase, iorange, "pcm3724")){ printk("I/O port conflict\n"); diff --git a/comedi/drivers/pcm3730.c b/comedi/drivers/pcm3730.c index bbe75eb3..31a66b87 100644 --- a/comedi/drivers/pcm3730.c +++ b/comedi/drivers/pcm3730.c @@ -65,10 +65,10 @@ static int pcm3730_di_insn_bits(comedi_device *dev,comedi_subdevice *s, static int pcm3730_attach(comedi_device *dev,comedi_devconfig *it) { comedi_subdevice *s; - int iobase; + unsigned long iobase; iobase=it->options[0]; - printk("comedi%d: pcm3730: 0x%04x ",dev->minor,iobase); + printk("comedi%d: pcm3730: 0x%04lx ",dev->minor,iobase); if(!request_region(iobase,PCM3730_SIZE,"pcm3730")){ printk("I/O port conflict\n"); return -EIO; diff --git a/comedi/drivers/pcmad.c b/comedi/drivers/pcmad.c index 509f4f15..9dcf0e8e 100644 --- a/comedi/drivers/pcmad.c +++ b/comedi/drivers/pcmad.c @@ -131,10 +131,10 @@ static int pcmad_attach(comedi_device *dev,comedi_devconfig *it) { int ret; comedi_subdevice *s; - int iobase; + unsigned long iobase; iobase=it->options[0]; - printk("comedi%d: pcmad: 0x%04x ",dev->minor,iobase); + printk("comedi%d: pcmad: 0x%04lx ",dev->minor,iobase); if(!request_region(iobase,PCMAD_SIZE,"pcmad")){ printk("I/O port conflict\n"); return -EIO; diff --git a/comedi/drivers/pcmda12.c b/comedi/drivers/pcmda12.c index 382ef092..5c2fb4a1 100644 --- a/comedi/drivers/pcmda12.c +++ b/comedi/drivers/pcmda12.c @@ -158,10 +158,10 @@ static int ao_rinsn(comedi_device *dev,comedi_subdevice *s, static int pcmda12_attach(comedi_device *dev, comedi_devconfig *it) { comedi_subdevice *s; - int iobase; + unsigned long iobase; iobase = it->options[0]; - printk("comedi%d: %s: io: %x %s ", dev->minor, driver.driver_name, iobase, it->options[1] ? "simultaneous xfer mode enabled" : ""); + printk("comedi%d: %s: io: %lx %s ", dev->minor, driver.driver_name, iobase, it->options[1] ? "simultaneous xfer mode enabled" : ""); if ( !request_region(iobase, IOSIZE, diff --git a/comedi/drivers/pcmuio.c b/comedi/drivers/pcmuio.c index a944db63..3b287089 100644 --- a/comedi/drivers/pcmuio.c +++ b/comedi/drivers/pcmuio.c @@ -210,7 +210,7 @@ typedef struct unsigned char enab[NUM_PAGED_REGS]; /* shadow of ENABx registers */ int num; unsigned long iobase; - int irq; + unsigned int irq; spinlock_t spinlock; } asics[MAX_ASICS]; pcmuio_subdev_private *sprivs; @@ -286,13 +286,15 @@ static void unlock_port(comedi_device *dev, int asic, int port); static int pcmuio_attach(comedi_device *dev, comedi_devconfig *it) { comedi_subdevice *s; - int sdev_no, chans_left, n_subdevs, iobase, irq[MAX_ASICS], port, asic, thisasic_chanct = 0; + int sdev_no, chans_left, n_subdevs, port, asic, thisasic_chanct = 0; + unsigned long iobase; + unsigned int irq[MAX_ASICS]; iobase = it->options[0]; irq[0] = it->options[1]; irq[1] = it->options[2]; - printk("comedi%d: %s: io: %x ", dev->minor, driver.driver_name, iobase); + printk("comedi%d: %s: io: %lx ", dev->minor, driver.driver_name, iobase); dev->iobase = iobase; @@ -427,9 +429,9 @@ static int pcmuio_attach(comedi_device *dev, comedi_devconfig *it) irqs.. */ if (irq[0]) { - printk("irq: %d ", irq[0]); + printk("irq: %u ", irq[0]); if (irq[1] && thisboard->num_asics == 2) - printk("second ASIC irq: %d ", irq[1]); + printk("second ASIC irq: %u ", irq[1]); } else { printk("(IRQ mode disabled) "); } @@ -499,7 +501,7 @@ static int pcmuio_dio_insn_bits(comedi_device *dev, comedi_subdevice *s, for (byte_no = 0; byte_no < s->n_chan/CHANS_PER_PORT; ++byte_no) { /* address of 8-bit port */ - int ioaddr = subpriv->iobases[byte_no], + unsigned long ioaddr = subpriv->iobases[byte_no], /* bit offset of port in 32-bit doubleword */ offset = byte_no * 8; /* this 8-bit port's data */ @@ -550,7 +552,8 @@ static int pcmuio_dio_insn_bits(comedi_device *dev, comedi_subdevice *s, static int pcmuio_dio_insn_config(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data) { - int chan = CR_CHAN(insn->chanspec), byte_no = chan/8, bit_no = chan % 8, ioaddr; + int chan = CR_CHAN(insn->chanspec), byte_no = chan/8, bit_no = chan % 8; + unsigned long ioaddr; unsigned char byte; /* Compute ioaddr for this channel */ @@ -612,7 +615,7 @@ static void init_asics(comedi_device *dev) /* sets up an for (asic = 0; asic < thisboard->num_asics; ++asic) { int port, page; - int baseaddr = dev->iobase + asic*ASIC_IOSIZE; + unsigned long baseaddr = dev->iobase + asic*ASIC_IOSIZE; switch_page(dev, asic, 0); /* switch back to page 0 */ @@ -687,7 +690,7 @@ static irqreturn_t interrupt_pcmuio(int irq, void *d, struct pt_regs *regs) if (irq == devpriv->asics[asic].irq) { unsigned long flags; unsigned triggered = 0; - int iobase = devpriv->asics[asic].iobase; + unsigned long iobase = devpriv->asics[asic].iobase; /* it is an interrupt for ASIC #asic */ unsigned char int_pend; diff --git a/comedi/drivers/poc.c b/comedi/drivers/poc.c index df51a5a4..259115c4 100644 --- a/comedi/drivers/poc.c +++ b/comedi/drivers/poc.c @@ -53,7 +53,7 @@ static int pcl734_insn_bits(comedi_device *dev,comedi_subdevice *s, struct boarddef_struct{ char *name; - int iosize; + unsigned int iosize; int (*setup)(comedi_device *); int type; int n_chan; @@ -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; } diff --git a/comedi/drivers/quatech_daqp_cs.c b/comedi/drivers/quatech_daqp_cs.c index f331e0cb..59aafed3 100644 --- a/comedi/drivers/quatech_daqp_cs.c +++ b/comedi/drivers/quatech_daqp_cs.c @@ -1343,7 +1343,7 @@ next_entry: if (link->conf.Vpp1) printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10); if (link->conf.Attributes & CONF_ENABLE_IRQ) - printk(", irq %d", link->irq.AssignedIRQ); + printk(", irq %u", link->irq.AssignedIRQ); if (link->io.NumPorts1) printk(", io 0x%04x-0x%04x", link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1-1); diff --git a/comedi/drivers/rtd520.c b/comedi/drivers/rtd520.c index d10faf29..2b589fb4 100644 --- a/comedi/drivers/rtd520.c +++ b/comedi/drivers/rtd520.c @@ -750,9 +750,9 @@ static int rtd_attach ( comedi_subdevice *s; struct pci_dev* pcidev; int ret; - unsigned long physLas0; /* configuation */ - unsigned long physLas1; /* data area */ - unsigned long physLcfg; /* PLX9080 */ + resource_size_t physLas0; /* configuation */ + resource_size_t physLas1; /* data area */ + resource_size_t physLcfg; /* PLX9080 */ #ifdef USE_DMA int index; #endif @@ -829,8 +829,9 @@ static int rtd_attach ( return -ENOMEM; } - DPRINTK ("%s: LAS0=%lx, LAS1=%lx, CFG=%lx.\n", dev->board_name, - physLas0, physLas1, physLcfg); + DPRINTK ("%s: LAS0=%llx, LAS1=%llx, CFG=%llx.\n", dev->board_name, + (unsigned long long)physLas0, (unsigned long long)physLas1, + (unsigned long long)physLcfg); { /* The RTD driver does this */ unsigned char pci_latency; u16 revision; @@ -924,11 +925,11 @@ static int rtd_attach ( /* check if our interrupt is available and get it */ if((ret=comedi_request_irq (devpriv->pci_dev->irq, rtd_interrupt, SA_SHIRQ, "rtd520", dev)) < 0) { - printk("Could not get interrupt! (%d)\n", devpriv->pci_dev->irq); + printk("Could not get interrupt! (%u)\n", devpriv->pci_dev->irq); return ret; } dev->irq = devpriv->pci_dev->irq; - printk("( irq=%d )", dev->irq); + printk("( irq=%u )", dev->irq); #ifdef USE_DMA if (dev->irq > 0) { diff --git a/comedi/drivers/rti800.c b/comedi/drivers/rti800.c index f15fa47b..bd6da78d 100644 --- a/comedi/drivers/rti800.c +++ b/comedi/drivers/rti800.c @@ -295,13 +295,13 @@ static int rti800_do_insn_bits(comedi_device *dev,comedi_subdevice *s, static int rti800_attach(comedi_device * dev, comedi_devconfig * it) { - int irq; - int iobase; + unsigned int irq; + unsigned long iobase; int ret; comedi_subdevice *s; iobase = it->options[0]; - printk("comedi%d: rti800: 0x%04x ", dev->minor, iobase); + printk("comedi%d: rti800: 0x%04lx ", dev->minor, iobase); if (!request_region(iobase, RTI800_SIZE, "rti800")) { printk("I/O port conflict\n"); return -EIO; @@ -322,12 +322,14 @@ static int rti800_attach(comedi_device * dev, comedi_devconfig * it) outb(0,dev->iobase+RTI800_CLRFLAGS); irq=it->options[1]; - if(irq>0){ - printk("( irq = %d )\n",irq); - if((ret=comedi_request_irq(irq,rti800_interrupt, 0, "rti800", dev))<0) + if(irq){ + printk("( irq = %u )",irq); + if((ret=comedi_request_irq(irq,rti800_interrupt, 0, "rti800", dev))<0){ + printk(" Failed to allocate IRQ\n"); return ret; + } dev->irq=irq; - }else if(irq == 0){ + }else{ printk("( no irq )"); } diff --git a/comedi/drivers/rti802.c b/comedi/drivers/rti802.c index 3b9612b0..782c5e70 100644 --- a/comedi/drivers/rti802.c +++ b/comedi/drivers/rti802.c @@ -101,10 +101,10 @@ static int rti802_attach(comedi_device * dev, comedi_devconfig * it) { comedi_subdevice *s; int i; - int iobase; + unsigned long iobase; iobase = it->options[0]; - printk("comedi%d: rti802: 0x%04x ", dev->minor, iobase); + printk("comedi%d: rti802: 0x%04lx ", dev->minor, iobase); if (!request_region(iobase, RTI802_SIZE, "rti802")) { printk("I/O port conflict\n"); return -EIO; diff --git a/comedi/drivers/s626.c b/comedi/drivers/s626.c index ca003db3..b0d3d041 100644 --- a/comedi/drivers/s626.c +++ b/comedi/drivers/s626.c @@ -479,7 +479,7 @@ static int s626_attach(comedi_device *dev,comedi_devconfig *it) int result; int i; int ret; - uint64_t resourceStart; + resource_size_t resourceStart; dma_addr_t appdma; comedi_subdevice *s; struct pci_dev *pdev; @@ -506,7 +506,7 @@ static int s626_attach(comedi_device *dev,comedi_devconfig *it) } devpriv->got_regions = 1; - resourceStart=(uint64_t)pci_resource_start(devpriv->pdev,0); + resourceStart=pci_resource_start(devpriv->pdev,0); devpriv->base_addr=ioremap(resourceStart, SIZEOF_ADDRESS_SPACE); if (devpriv->base_addr==NULL) { @@ -559,7 +559,7 @@ static int s626_attach(comedi_device *dev,comedi_devconfig *it) if(alloc_subdevices(dev, 6)<0) return -ENOMEM; - dev->iobase = (int)devpriv->base_addr; + dev->iobase = (unsigned long)devpriv->base_addr; dev->irq = devpriv->pdev->irq; //set up interrupt handler diff --git a/include/linux/comedidev.h b/include/linux/comedidev.h index b5028f35..848a3526 100644 --- a/include/linux/comedidev.h +++ b/include/linux/comedidev.h @@ -214,7 +214,7 @@ struct comedi_device_struct{ /* dumb */ unsigned long iobase; - int irq; + unsigned int irq; comedi_subdevice *read_subdev; wait_queue_head_t read_wait;