Commit e3c4bcca authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Linus Torvalds

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: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James Bottomley <James.Bottomley@suse.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Greg KH <greg@kroah.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c186caca
...@@ -2305,15 +2305,13 @@ void pci_msi_off(struct pci_dev *dev) ...@@ -2305,15 +2305,13 @@ void pci_msi_off(struct pci_dev *dev)
int int
pci_set_dma_mask(struct pci_dev *dev, u64 mask) pci_set_dma_mask(struct pci_dev *dev, u64 mask)
{ {
if (!pci_dma_supported(dev, mask)) int ret = dma_set_mask(&dev->dev, mask);
return -EIO; if (ret)
return ret;
dev->dma_mask = mask;
dev_dbg(&dev->dev, "using %dbit DMA mask\n", fls64(mask)); dev_dbg(&dev->dev, "using %dbit DMA mask\n", fls64(mask));
return 0; return 0;
} }
int int
pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment