[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: Tobias Klauser <tklauser@nuerscht.ch>

authored by Tobias Klauser and committed by Jeff Garzik cac8c81a 5f13e7ec

+4 -4
+4 -4
drivers/net/amd8111e.c
··· 87 #include <linux/if_vlan.h> 88 #include <linux/ctype.h> 89 #include <linux/crc32.h> 90 91 #include <asm/system.h> 92 #include <asm/io.h> ··· 2007 } 2008 2009 /* Initialize DMA */ 2010 - if(!pci_dma_supported(pdev, 0xffffffff)){ 2011 printk(KERN_ERR "amd8111e: DMA not supported," 2012 "exiting.\n"); 2013 - goto err_free_reg; 2014 - } else 2015 - pdev->dma_mask = 0xffffffff; 2016 2017 reg_addr = pci_resource_start(pdev, 0); 2018 reg_len = pci_resource_len(pdev, 0);
··· 87 #include <linux/if_vlan.h> 88 #include <linux/ctype.h> 89 #include <linux/crc32.h> 90 + #include <linux/dma-mapping.h> 91 92 #include <asm/system.h> 93 #include <asm/io.h> ··· 2006 } 2007 2008 /* Initialize DMA */ 2009 + if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) < 0) { 2010 printk(KERN_ERR "amd8111e: DMA not supported," 2011 "exiting.\n"); 2012 + goto err_free_reg; 2013 + } 2014 2015 reg_addr = pci_resource_start(pdev, 0); 2016 reg_len = pci_resource_len(pdev, 0);