Skip to content

Commit

Permalink
[PATCH] Use pci_set_dma_mask() instead of direct assignment of DMA mask
Browse files Browse the repository at this point in the history
The amd8111e driver directly assigns the DMA mask to the dma_mask
member of the struct pci_dev instead of using pci_set_dma_mask(). This
makes the call to pci_dma_supported() redundant as pci_set_dma_mask()
does this check.

I do not own this device so I only compile-tested this patch.

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
  • Loading branch information
Tobias Klauser authored and Jeff Garzik committed Jun 28, 2005
1 parent 5f13e7e commit cac8c81
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/amd8111e.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Revision History:
#include <linux/if_vlan.h>
#include <linux/ctype.h>
#include <linux/crc32.h>
#include <linux/dma-mapping.h>

#include <asm/system.h>
#include <asm/io.h>
Expand Down Expand Up @@ -2006,12 +2007,11 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
}

/* Initialize DMA */
if(!pci_dma_supported(pdev, 0xffffffff)){
if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) < 0) {
printk(KERN_ERR "amd8111e: DMA not supported,"
"exiting.\n");
goto err_free_reg;
} else
pdev->dma_mask = 0xffffffff;
goto err_free_reg;
}

reg_addr = pci_resource_start(pdev, 0);
reg_len = pci_resource_len(pdev, 0);
Expand Down

0 comments on commit cac8c81

Please sign in to comment.