All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] sparc/PCI: Use dev_is_pci() to identify PCI devices
@ 2013-12-11  6:00 ` Yijing Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Yijing Wang @ 2013-12-11  6:00 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, sparclinux, Yijing Wang, Hanjun Guo

Use dev_is_pci() instead of checking bus type directly.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---

v2->v3: Keep use dev->bus == &pci_bus_type in 
        arch/sparc/include/asm/dma-mapping.h, because we
		can't include <linux/pci.h> in this file, or it will
		cause lots of building errors, it's so strange. 
		This patch was built ok in my Cross Complier.

---
 arch/sparc/kernel/iommu.c  |    2 +-
 arch/sparc/kernel/ioport.c |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index 070ed14..76663b0 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -854,7 +854,7 @@ int dma_supported(struct device *dev, u64 device_mask)
 		return 1;
 
 #ifdef CONFIG_PCI
-	if (dev->bus == &pci_bus_type)
+	if (dev_is_pci(dev))
 		return pci64_dma_supported(to_pci_dev(dev), device_mask);
 #endif
 
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 2096468..e7e215d 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -666,10 +666,9 @@ EXPORT_SYMBOL(dma_ops);
  */
 int dma_supported(struct device *dev, u64 mask)
 {
-#ifdef CONFIG_PCI
-	if (dev->bus == &pci_bus_type)
+	if (dev_is_pci(dev))
 		return 1;
-#endif
+
 	return 0;
 }
 EXPORT_SYMBOL(dma_supported);
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-01-06  7:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-11  6:00 [PATCH v3] sparc/PCI: Use dev_is_pci() to identify PCI devices Yijing Wang
2013-12-11  6:00 ` Yijing Wang
2014-01-05  2:05 ` David Miller
2014-01-05  2:05   ` David Miller
2014-01-06  1:08   ` Yijing Wang
2014-01-06  1:08     ` Yijing Wang
2014-01-06  1:35     ` David Miller
2014-01-06  1:35       ` David Miller
2014-01-06  7:45       ` Yijing Wang
2014-01-06  7:45         ` Yijing Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.