}
request_mem_region(start, length, "mite (daq)");
mite->daq_io_addr = ioremap(start, length) + offset;
- printk("DAQ:0x%08lx mapped to %p, ",mite->daq_phys_addr,mite->daq_io_addr);
+ printk("DAQ:0x%08lx mapped to %p\n",mite->daq_phys_addr,mite->daq_io_addr);
/* XXX don't know what the 0xc0 and 0x80 mean */
/* It must be here for the driver to work though */
mite->used = 1;
- return (int) mite->daq_io_addr;
+ return 0;
}
extern struct mite_struct *mite_devices;
#ifdef PCI_SUPPORT_VER1
-#define mite_irq(a) ((a)->irq)
-#define mite_device_id(a) ((a)->device_id)
+extern inline unsigned int mite_irq(struct mite_struct *mite)
+{
+ return mite->irq;
+};
+extern inline unsigned int mite_device_id(struct mite_struct *mite)
+{
+ return mite->device_id;
+};
#else
-#define mite_irq(a) ((a)->pcidev->irq)
-#define mite_device_id(a) ((a)->pcidev->device)
+extern inline unsigned int mite_irq(struct mite_struct *mite)
+{
+ return mite->pcidev->irq;
+};
+extern inline unsigned int mite_device_id(struct mite_struct *mite)
+{
+ return mite->pcidev->device;
+};
#endif
-#define mite_iobase(a) ((a)->daq_io_addr)
+extern inline unsigned long mite_iobase(struct mite_struct *mite)
+{
+ return (unsigned long) mite->daq_io_addr;
+};
void mite_init(void);
ret=ni_670x_find_device(dev,it->options[0],it->options[1]);
if(ret<0) return ret;
- dev->iobase=mite_setup(devpriv->mite);
+ ret = mite_setup(devpriv->mite);
+ if(ret < 0)
+ {
+ printk("error setting up mite\n");
+ return ret;
+ }
+ dev->iobase=mite_iobase(devpriv->mite);
dev->board_name=thisboard->name;
dev->irq=mite_irq(devpriv->mite);
printk(" %s",dev->board_name);
int lsb, msb;
int i;
unsigned long flags, isr_flags;
+ int ret;
#ifdef CONFIG_PCMCIA
dev_link_t *link;
#endif
printk("bug! mite device id does not match boardtype definition\n");
return -EINVAL;
}
- iobase = mite_setup(devpriv->mite);
- if(iobase < 0) return -EIO;
+ ret = mite_setup(devpriv->mite);
+ if(ret < 0) return ret;
+ iobase = mite_iobase(devpriv->mite);
irq = mite_irq(devpriv->mite);
break;
case pcmcia_bustype:
ret=nidio_find_device(dev,it->options[0],it->options[1]);
if(ret<0)return ret;
- dev->iobase=mite_setup(devpriv->mite);
+ ret = mite_setup(devpriv->mite);
+ if(ret < 0)
+ {
+ printk("error setting up mite\n");
+ return ret;
+ }
+ dev->iobase = mite_iobase(devpriv->mite);
dev->board_name=this_board->name;
dev->irq=mite_irq(devpriv->mite);
printk(" %s",boardtype.name);
dev->board_name=boardtype.name;
- dev->iobase=mite_setup(devpriv->mite);
+ ret = mite_setup(devpriv->mite);
+ if(ret < 0)
+ {
+ printk(" error setting up mite\n");
+ return ret;
+ }
+ dev->iobase = mite_iobase(devpriv->mite);
dev->irq=mite_irq(devpriv->mite);