diff options
author | Rob Herring <robh@kernel.org> | 2018-11-16 15:06:59 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-18 13:35:21 -0800 |
commit | 88ca0557a01386834cbb59d5fc43041e810cbc69 (patch) | |
tree | 52b03e8f6b668ed89277548d2c0f895e4c5d82ed /arch/sparc/kernel/pci.c | |
parent | 29c990dfc77c58b21a0f2ff4640b6a26955d0661 (diff) |
sparc: Use device_type helpers to access the node type
Remove directly accessing device_node.type pointer and use the accessors
instead. This will eventually allow removing the type pointer.
Replace the open coded iterating over child nodes with
for_each_child_of_node() while we're here.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/pci.c')
-rw-r--r-- | arch/sparc/kernel/pci.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 377113ae9a6a..bcfec6a85d23 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -267,7 +267,6 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, struct dev_archdata *sd; struct platform_device *op; struct pci_dev *dev; - const char *type; u32 class; dev = pci_alloc_dev(bus); @@ -286,13 +285,9 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, if (of_node_name_eq(node, "ebus")) of_propagate_archdata(op); - type = of_get_property(node, "device_type", NULL); - if (type == NULL) - type = ""; - if (ofpci_verbose) pci_info(bus," create device, devfn: %x, type: %s\n", - devfn, type); + devfn, of_node_get_device_type(node)); dev->sysdata = node; dev->dev.parent = bus->bridge; @@ -340,7 +335,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, /* a PCI-PCI bridge */ dev->hdr_type = PCI_HEADER_TYPE_BRIDGE; dev->rom_base_reg = PCI_ROM_ADDRESS1; - } else if (!strcmp(type, "cardbus")) { + } else if (of_node_is_type(node, "cardbus")) { dev->hdr_type = PCI_HEADER_TYPE_CARDBUS; } else { dev->hdr_type = PCI_HEADER_TYPE_NORMAL; |