diff mbox

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

Message ID 1386741626-35744-1-git-send-email-wangyijing@huawei.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Yijing Wang Dec. 11, 2013, 6 a.m. UTC
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(-)

Comments

David Miller Jan. 5, 2014, 2:05 a.m. UTC | #1
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. UTC | #2
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. UTC | #3
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. UTC | #4
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!

> 
>
diff mbox

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