aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_64.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-12-17 01:35:53 -0500
committerPaul Mackerras <paulus@samba.org>2007-12-20 00:15:49 -0500
commit84631f37cc405dd6dcd566f9fa4e8a3ca2f03f76 (patch)
treece0657276d19baf01ad8da9f1b27f93feb75bb63 /arch/powerpc/kernel/pci_64.c
parent53024fe250a0f044b114844a01456902bce40ade (diff)
[POWERPC] Implement pci_set_dma_mask() in terms of the dma_ops
PowerPC currently doesn't implement pci_set_dma_mask(), which means drivers calling it will get the generic version in drivers/pci/pci.c. The powerpc dma mapping ops include a dma_set_mask() hook, which luckily is not implemented by anyone - so there is no bug in the fact that the hook is currently never called. However in future we'll add implementation(s) of dma_set_mask(), and so we need pci_set_dma_mask() to call the hook. To save adding a hook to the dma mapping ops, pci-set_consistent_dma_mask() simply calls the dma_set_mask() hook and then copies the new mask into dev.coherenet_dma_mask. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r--arch/powerpc/kernel/pci_64.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index bf06926f677d..f5c4628698b9 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -69,6 +69,22 @@ struct dma_mapping_ops *get_pci_dma_ops(void)
69} 69}
70EXPORT_SYMBOL(get_pci_dma_ops); 70EXPORT_SYMBOL(get_pci_dma_ops);
71 71
72
73int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
74{
75 return dma_set_mask(&dev->dev, mask);
76}
77
78int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
79{
80 int rc;
81
82 rc = dma_set_mask(&dev->dev, mask);
83 dev->dev.coherent_dma_mask = dev->dma_mask;
84
85 return rc;
86}
87
72static void fixup_broken_pcnet32(struct pci_dev* dev) 88static void fixup_broken_pcnet32(struct pci_dev* dev)
73{ 89{
74 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { 90 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {