[PATCH] skge: dma configuration cleanup
authorStephen Hemminger <shemminger@osdl.org>
Tue, 21 Mar 2006 18:57:02 +0000 (10:57 -0800)
committerJeff Garzik <jeff@garzik.org>
Tue, 21 Mar 2006 21:00:50 +0000 (16:00 -0500)
Cleanup of the part of the code that sets up DMA configuration.
Should cause no real change in operation, just clearer.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/skge.c

index deca5066a4474c82cc0d42c63658802333d25717..381669cc415feb5719f0b06ffa3a024d1f232444 100644 (file)
@@ -3251,22 +3251,18 @@ static int __devinit skge_probe(struct pci_dev *pdev,
 
        pci_set_master(pdev);
 
-       if (sizeof(dma_addr_t) > sizeof(u32) &&
-           !(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
+       if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
                using_dac = 1;
                err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
-               if (err < 0) {
-                       printk(KERN_ERR PFX "%s unable to obtain 64 bit DMA "
-                              "for consistent allocations\n", pci_name(pdev));
-                       goto err_out_free_regions;
-               }
-       } else {
-               err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
-               if (err) {
-                       printk(KERN_ERR PFX "%s no usable DMA configuration\n",
-                              pci_name(pdev));
-                       goto err_out_free_regions;
-               }
+       } else if (!(err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
+               using_dac = 0;
+               err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
+       }
+
+       if (err) {
+               printk(KERN_ERR PFX "%s no usable DMA configuration\n",
+                      pci_name(pdev));
+               goto err_out_free_regions;
        }
 
 #ifdef __BIG_ENDIAN