From: Frank Mori Hess Date: Sun, 27 Feb 2005 23:47:50 +0000 (+0000) Subject: patch from abbotti@mev.co.uk (Ian Abbott): X-Git-Tag: r0_7_70~36 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=094ea4f3559911244663ab7dd9f80ec5d874e046;p=comedi.git patch from abbotti@mev.co.uk (Ian Abbott): "modprobe dt3000" fails on current 2.6 kernels due to missing symbols in the PCI stuff. The attached patch should fix it, but needs testing properly. I've checked that it modprobes okay, but don't have the hardware to make sure it finds the board okay. --- diff --git a/comedi/drivers/dt3000.c b/comedi/drivers/dt3000.c index 241fa368..d8532ac6 100644 --- a/comedi/drivers/dt3000.c +++ b/comedi/drivers/dt3000.c @@ -888,58 +888,21 @@ static int setup_pci(comedi_device *dev) return 0; } -#if LINUX_VERSION_CODE < 0x020300 static struct pci_dev *dt_pci_find_device(struct pci_dev *from,int *board) { int i; - if(!from){ - from=pci_devices; - }else{ - from=from->next; - } - while(from){ - if(from->vendor == PCI_VENDOR_ID_DT){ - for(i=0;idevice == dt3k_boardtypes[i].device_id){ - *board=i; - return from; - } - } - printk("unknown Data Translation PCI device found with device_id=0x%04x\n",from->device); - } - from=from->next; - } - *board=-1; - return from; -} - -#else - -static struct pci_dev *dt_pci_find_device(struct pci_dev *from,int *board) -{ - int i; - - if(!from){ - from=(struct pci_dev *)(pci_devices.next); - }else{ - from=(struct pci_dev *)(from->global_list.next); - } - while(from){ - if(from->vendor == PCI_VENDOR_ID_DT){ - for(i=0;idevice == dt3k_boardtypes[i].device_id){ - *board=i; - return from; - } + for(from=pci_find_device(PCI_VENDOR_ID_DT,PCI_ANY_ID,from); from!=NULL; + from=pci_find_device(PCI_VENDOR_ID_DT,PCI_ANY_ID,from)){ + for(i=0;idevice == dt3k_boardtypes[i].device_id){ + *board=i; + return from; } - printk("unknown Data Translation PCI device found with device_id=0x%04x\n",from->device); } - from=(struct pci_dev *)(from->global_list.next); + printk("unknown Data Translation PCI device found with device_id=0x%04x\n",from->device); } *board=-1; return from; } -#endif -