Skip to contentSkip to conversation

xen: Use dev_is_pci() to check whether it is pci device

PATCH In review Yijing Wang 3 participants 5 messages Dec 5, 2013 – Jan 7, 2014 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: Use dev_is_pci() to check whether it is pci device

Use PCI standard marco dev_is_pci() instead of directly compare pci_bus_type to check whether it is pci device.

---
 drivers/xen/dbgp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/xen/dbgp.c +1 -1
index f3ccc80..8145a59 100644
@@ -19,7 +19,7 @@ static int xen_dbgp_op(struct usb_hcd *hcd, int op)
 	dbgp.op = op;
 
 #ifdef CONFIG_PCI
-	if (ctrlr->bus == &pci_bus_type) {
+	if (dev_is_pci(ctrlr)) {
 		const struct pci_dev *pdev = to_pci_dev(ctrlr);
 
 		dbgp.u.pci.seg = pci_domain_nr(pdev->bus);
Signature · 1 line
1.7.1
#1 lore raw
Quoted 2 lines · Yijing Wang

Use PCI standard marco dev_is_pci() instead of directly compare pci_bus_type to check whether it is pci device.

Jan, you OK with this?

Quoted 23 lines
---
 drivers/xen/dbgp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/xen/dbgp.c +1 -1
index f3ccc80..8145a59 100644
@@ -19,7 +19,7 @@ static int xen_dbgp_op(struct usb_hcd *hcd, int op)
 	dbgp.op = op;
 
 #ifdef CONFIG_PCI
-	if (ctrlr->bus == &pci_bus_type) {
+	if (dev_is_pci(ctrlr)) {
 		const struct pci_dev *pdev = to_pci_dev(ctrlr);
 
 		dbgp.u.pci.seg = pci_domain_nr(pdev->bus);
Signature · 1 line
1.7.1
#2 lore raw
In reply to Yijing Wang
Quoted 2 lines · Yijing Wang

Use PCI standard marco dev_is_pci() instead of directly compare pci_bus_type to check whether it is pci device.

Jan, you OK with this?

Quoted 23 lines
---
 drivers/xen/dbgp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/xen/dbgp.c +1 -1
index f3ccc80..8145a59 100644
@@ -19,7 +19,7 @@ static int xen_dbgp_op(struct usb_hcd *hcd, int op)
 	dbgp.op = op;
 
 #ifdef CONFIG_PCI
-	if (ctrlr->bus == &pci_bus_type) {
+	if (dev_is_pci(ctrlr)) {
 		const struct pci_dev *pdev = to_pci_dev(ctrlr);
 
 		dbgp.u.pci.seg = pci_domain_nr(pdev->bus);
Signature · 1 line
1.7.1
#3 lore raw
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Konrad Rzeszutek Wilk
Quoted 2 lines · Yijing Wang

Use PCI standard marco dev_is_pci() instead of directly compare pci_bus_type to check whether it is pci device.

Jan, you OK with this?

Yes, sure - I simply wasn't aware of that wrapper.

Jan

Quoted 22 lines
Quoted 22 lines
---
 drivers/xen/dbgp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/xen/dbgp.c +1 -1
index f3ccc80..8145a59 100644
@@ -19,7 +19,7 @@ static int xen_dbgp_op(struct usb_hcd *hcd, int op)
 	dbgp.op = op;
 
 #ifdef CONFIG_PCI
-	if (ctrlr->bus == &pci_bus_type) {
+	if (dev_is_pci(ctrlr)) {
 		const struct pci_dev *pdev = to_pci_dev(ctrlr);
 
 		dbgp.u.pci.seg = pci_domain_nr(pdev->bus);
Signature · 1 line
1.7.1
#4 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Konrad Rzeszutek Wilk
Quoted 2 lines · Yijing Wang

Use PCI standard marco dev_is_pci() instead of directly compare pci_bus_type to check whether it is pci device.

Jan, you OK with this?

Yes, sure - I simply wasn't aware of that wrapper.

Jan

Quoted 22 lines
Quoted 22 lines
---
 drivers/xen/dbgp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/xen/dbgp.c +1 -1
index f3ccc80..8145a59 100644
@@ -19,7 +19,7 @@ static int xen_dbgp_op(struct usb_hcd *hcd, int op)
 	dbgp.op = op;
 
 #ifdef CONFIG_PCI
-	if (ctrlr->bus == &pci_bus_type) {
+	if (dev_is_pci(ctrlr)) {
 		const struct pci_dev *pdev = to_pci_dev(ctrlr);
 
 		dbgp.u.pci.seg = pci_domain_nr(pdev->bus);
Signature · 1 line
1.7.1