aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorYijing Wang <wangyijing@huawei.com>2013-12-05 06:59:38 -0500
committerBjorn Helgaas <bhelgaas@google.com>2013-12-11 18:53:12 -0500
commitb0acbb9d36e66fc773d4b1375cfaede1356de422 (patch)
treea81cb695d5395c2e054c997cea1cdf401291308f /arch/parisc
parentdf907938cc46a7f5ab2df44e56cebc4f277b8356 (diff)
parisc/PCI: Use dev_is_pci() to identify PCI devices
Use dev_is_pci() instead of equivalent local function. Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/kernel/drivers.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index 14285caec71a..dba508fe1683 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -282,18 +282,6 @@ find_pa_parent_type(const struct parisc_device *padev, int type)
282 return NULL; 282 return NULL;
283} 283}
284 284
285#ifdef CONFIG_PCI
286static inline int is_pci_dev(struct device *dev)
287{
288 return dev->bus == &pci_bus_type;
289}
290#else
291static inline int is_pci_dev(struct device *dev)
292{
293 return 0;
294}
295#endif
296
297/* 285/*
298 * get_node_path fills in @path with the firmware path to the device. 286 * get_node_path fills in @path with the firmware path to the device.
299 * Note that if @node is a parisc device, we don't fill in the 'mod' field. 287 * Note that if @node is a parisc device, we don't fill in the 'mod' field.
@@ -306,7 +294,7 @@ static void get_node_path(struct device *dev, struct hardware_path *path)
306 int i = 5; 294 int i = 5;
307 memset(&path->bc, -1, 6); 295 memset(&path->bc, -1, 6);
308 296
309 if (is_pci_dev(dev)) { 297 if (dev_is_pci(dev)) {
310 unsigned int devfn = to_pci_dev(dev)->devfn; 298 unsigned int devfn = to_pci_dev(dev)->devfn;
311 path->mod = PCI_FUNC(devfn); 299 path->mod = PCI_FUNC(devfn);
312 path->bc[i--] = PCI_SLOT(devfn); 300 path->bc[i--] = PCI_SLOT(devfn);
@@ -314,7 +302,7 @@ static void get_node_path(struct device *dev, struct hardware_path *path)
314 } 302 }
315 303
316 while (dev != &root) { 304 while (dev != &root) {
317 if (is_pci_dev(dev)) { 305 if (dev_is_pci(dev)) {
318 unsigned int devfn = to_pci_dev(dev)->devfn; 306 unsigned int devfn = to_pci_dev(dev)->devfn;
319 path->bc[i--] = PCI_SLOT(devfn) | (PCI_FUNC(devfn)<< 5); 307 path->bc[i--] = PCI_SLOT(devfn) | (PCI_FUNC(devfn)<< 5);
320 } else if (dev->bus == &parisc_bus_type) { 308 } else if (dev->bus == &parisc_bus_type) {
@@ -695,7 +683,7 @@ static int check_parent(struct device * dev, void * data)
695 if (dev->bus == &parisc_bus_type) { 683 if (dev->bus == &parisc_bus_type) {
696 if (match_parisc_device(dev, d->index, d->modpath)) 684 if (match_parisc_device(dev, d->index, d->modpath))
697 d->dev = dev; 685 d->dev = dev;
698 } else if (is_pci_dev(dev)) { 686 } else if (dev_is_pci(dev)) {
699 if (match_pci_device(dev, d->index, d->modpath)) 687 if (match_pci_device(dev, d->index, d->modpath))
700 d->dev = dev; 688 d->dev = dev;
701 } else if (dev->bus == NULL) { 689 } else if (dev->bus == NULL) {
@@ -753,7 +741,7 @@ struct device *hwpath_to_device(struct hardware_path *modpath)
753 if (!parent) 741 if (!parent)
754 return NULL; 742 return NULL;
755 } 743 }
756 if (is_pci_dev(parent)) /* pci devices already parse MOD */ 744 if (dev_is_pci(parent)) /* pci devices already parse MOD */
757 return parent; 745 return parent;
758 else 746 else
759 return parse_tree_node(parent, 6, modpath); 747 return parse_tree_node(parent, 6, modpath);
@@ -772,7 +760,7 @@ void device_to_hwpath(struct device *dev, struct hardware_path *path)
772 padev = to_parisc_device(dev); 760 padev = to_parisc_device(dev);
773 get_node_path(dev->parent, path); 761 get_node_path(dev->parent, path);
774 path->mod = padev->hw_path; 762 path->mod = padev->hw_path;
775 } else if (is_pci_dev(dev)) { 763 } else if (dev_is_pci(dev)) {
776 get_node_path(dev, path); 764 get_node_path(dev, path);
777 } 765 }
778} 766}