]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/block/cciss.c
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
[linux-2.6-omap-h63xx.git] / drivers / block / cciss.c
index 4e5441baa49dcac0ab9ea64d034f8a63cb4f4024..0ef6f08aa6eadfbdb685704eb5fe5f039ff8e474 100644 (file)
@@ -3265,12 +3265,21 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
  */
        cciss_interrupt_mode(c, pdev, board_id);
 
-       /*
-        * Memory base addr is first addr , the second points to the config
-        *   table
-        */
+       /* find the memory BAR */
+       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
+               if (pci_resource_flags(pdev, i) & IORESOURCE_MEM)
+                       break;
+       }
+       if (i == DEVICE_COUNT_RESOURCE) {
+               printk(KERN_WARNING "cciss: No memory BAR found\n");
+               err = -ENODEV;
+               goto err_out_free_res;
+       }
+
+       c->paddr = pci_resource_start(pdev, i); /* addressing mode bits
+                                                * already removed
+                                                */
 
-       c->paddr = pci_resource_start(pdev, 0); /* addressing mode bits already removed */
 #ifdef CCISS_DEBUG
        printk("address 0 = %lx\n", c->paddr);
 #endif                         /* CCISS_DEBUG */
@@ -3721,9 +3730,9 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
        hba[i]->pdev = pdev;
 
        /* configure PCI DMA stuff */
-       if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK))
+       if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)))
                dac = 1;
-       else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK))
+       else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))
                dac = 0;
        else {
                printk(KERN_ERR "cciss: no suitable DMA available\n");