From: FUJITA Tomonori Date: Wed, 10 Mar 2010 23:23:38 +0000 (-0800) Subject: dma-mapping: pci: convert pci_set_dma_mask to call dma_set_mask X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=e3c4bccabaf3e5c13f4b307c7737cbe8d0cecd02;p=deliverable%2Flinux.git dma-mapping: pci: convert pci_set_dma_mask to call dma_set_mask This changes pci_set_dma_mask to call the generic DMA API, dma_set_mask. pci_set_dma_mask (in drivers/pci/pci.c) does the same things that dma_set_mask does on all the architectures that use pci_set_dma_mask; calls dma_supprted and sets dev->dma_mask. So we safely change pci_set_dma_mask to simply call dma_set_mask. Signed-off-by: FUJITA Tomonori Cc: James Bottomley Cc: David S. Miller Cc: Jesse Barnes Acked-by: Benjamin Herrenschmidt Cc: Russell King Cc: Greg KH Cc: Kay Sievers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index fdcf01af6762..b2d23d1b0d41 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2305,15 +2305,13 @@ void pci_msi_off(struct pci_dev *dev) int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { - if (!pci_dma_supported(dev, mask)) - return -EIO; - - dev->dma_mask = mask; + int ret = dma_set_mask(&dev->dev, mask); + if (ret) + return ret; dev_dbg(&dev->dev, "using %dbit DMA mask\n", fls64(mask)); - return 0; } - + int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) {