Patchwork [v3] sparc/PCI: Use dev_is_pci() to identify PCI devices

login
register
mail settings
Submitter Yijing Wang
Date Dec. 11, 2013, 6 a.m.
Message ID <1386741626-35744-1-git-send-email-wangyijing@huawei.com>
Download mbox | patch
Permalink /patch/299814/
State Accepted
Delegated to: David Miller
Headers show

Comments

Yijing Wang - Dec. 11, 2013, 6 a.m.
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(-)
David Miller - Jan. 5, 2014, 2:05 a.m.
From: Yijing Wang <wangyijing@huawei.com>
Date: Wed, 11 Dec 2013 14:00:26 +0800

> 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>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yijing Wang - Jan. 6, 2014, 1:08 a.m.
On 2014/1/5 10:05, David Miller wrote:
> From: Yijing Wang <wangyijing@huawei.com>
> Date: Wed, 11 Dec 2013 14:00:26 +0800
> 
>> 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>
> 
> Applied.
> 
> 
Hi David,
   This patch has been merged in Bjorn's pci tree, so will have some conflict between yours and Bjorn's tree?
David Miller - Jan. 6, 2014, 1:35 a.m.
From: Yijing Wang <wangyijing@huawei.com>
Date: Mon, 6 Jan 2014 09:08:28 +0800

>    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.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yijing Wang - Jan. 6, 2014, 7:45 a.m.
On 2014/1/6 9:35, David Miller wrote:
> From: Yijing Wang <wangyijing@huawei.com>
> Date: Mon, 6 Jan 2014 09:08:28 +0800
> 
>>    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!

> 
>

Patch

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);