提交 cac8c81a 编写于 作者: T Tobias Klauser 提交者: Jeff Garzik

[PATCH] Use pci_set_dma_mask() instead of direct assignment of DMA mask

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: NTobias Klauser <tklauser@nuerscht.ch>
上级 5f13e7ec
...@@ -87,6 +87,7 @@ Revision History: ...@@ -87,6 +87,7 @@ Revision History:
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/crc32.h> #include <linux/crc32.h>
#include <linux/dma-mapping.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -2006,12 +2007,11 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev, ...@@ -2006,12 +2007,11 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
} }
/* Initialize DMA */ /* 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," printk(KERN_ERR "amd8111e: DMA not supported,"
"exiting.\n"); "exiting.\n");
goto err_free_reg; goto err_free_reg;
} else }
pdev->dma_mask = 0xffffffff;
reg_addr = pci_resource_start(pdev, 0); reg_addr = pci_resource_start(pdev, 0);
reg_len = pci_resource_len(pdev, 0); reg_len = pci_resource_len(pdev, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册