Skip to contentSkip to conversation

sparc/PCI: Use dev_is_pci() to identify PCI devices

PATCH Applied Yijing Wang 2 participants 5 messages Dec 11, 2013 – Jan 6, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 sparc/PCI: Use dev_is_pci() to identify PCI devices

Use dev_is_pci() instead of checking bus type directly.

---

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(-)
arch/sparc/kernel/iommu.c +1 -1
index 070ed14..76663b0 100644
@@ -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
 
arch/sparc/kernel/ioport.c +2 -3
index 2096468..e7e215d 100644
@@ -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);
Signature · 1 line
1.7.1
maintainer
#3 lore raw

From: Yijing Wang <[email protected]>
Date: Mon, 6 Jan 2014 09:08:28 +0800

Quoted 1 line

This patch has been merged in Bjorn's pci tree, so will have some conflict between yours and Bjorn's tree?

GIT will figure it out just fine.

#4 lore raw
Quoted 6 lines · David Miller

From: Yijing Wang <[email protected]>
Date: Mon, 6 Jan 2014 09:08:28 +0800

Quoted 1 line

This patch has been merged in Bjorn's pci tree, so will have some conflict between yours and Bjorn's tree?

GIT will figure it out just fine.

OK, thanks very much!

Quoted 2 lines
Signature · 2 lines
Thanks!
Yijing