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