diff options
author | Rob Herring <robh@kernel.org> | 2018-08-29 14:34:40 -0400 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2018-09-25 04:40:03 -0400 |
commit | de17c5200237e93a2de1188e5cf885686ac8f79d (patch) | |
tree | 5c3d9c9cbf10fb5a3712095b8dd28b951481b3e2 | |
parent | 7876320f88802b22d4e2daf7eb027dd14175a0f8 (diff) |
PCI: Remove unnecessary check of device_type == pci
PCI host drivers have already matched on compatible strings, so checking
device_type is redundant. Also, device_type is considered deprecated for
FDT though we've still been requiring it for PCI hosts as it is useful
for finding PCI buses.
Signed-off-by: Rob Herring <robh@kernel.org>
[lorenzo.pieralisi@arm.com: reformatted the log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Alan Douglas <adouglas@cadence.com>
Acked-by: Subrahmaya Lingappa <l.subrahmanya@mobiveil.co.in>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Alan Douglas <adouglas@cadence.com>
Cc: Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
-rw-r--r-- | drivers/pci/controller/pci-host-common.c | 8 | ||||
-rw-r--r-- | drivers/pci/controller/pcie-cadence-host.c | 7 | ||||
-rw-r--r-- | drivers/pci/controller/pcie-mobiveil.c | 7 | ||||
-rw-r--r-- | drivers/pci/controller/pcie-xilinx-nwl.c | 9 | ||||
-rw-r--r-- | drivers/pci/controller/pcie-xilinx.c | 7 |
5 files changed, 0 insertions, 38 deletions
diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c index d8f10451f273..c742881b5061 100644 --- a/drivers/pci/controller/pci-host-common.c +++ b/drivers/pci/controller/pci-host-common.c | |||
@@ -58,9 +58,7 @@ err_out: | |||
58 | int pci_host_common_probe(struct platform_device *pdev, | 58 | int pci_host_common_probe(struct platform_device *pdev, |
59 | struct pci_ecam_ops *ops) | 59 | struct pci_ecam_ops *ops) |
60 | { | 60 | { |
61 | const char *type; | ||
62 | struct device *dev = &pdev->dev; | 61 | struct device *dev = &pdev->dev; |
63 | struct device_node *np = dev->of_node; | ||
64 | struct pci_host_bridge *bridge; | 62 | struct pci_host_bridge *bridge; |
65 | struct pci_config_window *cfg; | 63 | struct pci_config_window *cfg; |
66 | struct list_head resources; | 64 | struct list_head resources; |
@@ -70,12 +68,6 @@ int pci_host_common_probe(struct platform_device *pdev, | |||
70 | if (!bridge) | 68 | if (!bridge) |
71 | return -ENOMEM; | 69 | return -ENOMEM; |
72 | 70 | ||
73 | type = of_get_property(np, "device_type", NULL); | ||
74 | if (!type || strcmp(type, "pci")) { | ||
75 | dev_err(dev, "invalid \"device_type\" %s\n", type); | ||
76 | return -EINVAL; | ||
77 | } | ||
78 | |||
79 | of_pci_check_probe_only(); | 71 | of_pci_check_probe_only(); |
80 | 72 | ||
81 | /* Parse and map our Configuration Space windows */ | 73 | /* Parse and map our Configuration Space windows */ |
diff --git a/drivers/pci/controller/pcie-cadence-host.c b/drivers/pci/controller/pcie-cadence-host.c index ec394f6a19c8..97e251090b4f 100644 --- a/drivers/pci/controller/pcie-cadence-host.c +++ b/drivers/pci/controller/pcie-cadence-host.c | |||
@@ -235,7 +235,6 @@ static int cdns_pcie_host_init(struct device *dev, | |||
235 | 235 | ||
236 | static int cdns_pcie_host_probe(struct platform_device *pdev) | 236 | static int cdns_pcie_host_probe(struct platform_device *pdev) |
237 | { | 237 | { |
238 | const char *type; | ||
239 | struct device *dev = &pdev->dev; | 238 | struct device *dev = &pdev->dev; |
240 | struct device_node *np = dev->of_node; | 239 | struct device_node *np = dev->of_node; |
241 | struct pci_host_bridge *bridge; | 240 | struct pci_host_bridge *bridge; |
@@ -268,12 +267,6 @@ static int cdns_pcie_host_probe(struct platform_device *pdev) | |||
268 | rc->device_id = 0xffff; | 267 | rc->device_id = 0xffff; |
269 | of_property_read_u16(np, "device-id", &rc->device_id); | 268 | of_property_read_u16(np, "device-id", &rc->device_id); |
270 | 269 | ||
271 | type = of_get_property(np, "device_type", NULL); | ||
272 | if (!type || strcmp(type, "pci")) { | ||
273 | dev_err(dev, "invalid \"device_type\" %s\n", type); | ||
274 | return -EINVAL; | ||
275 | } | ||
276 | |||
277 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg"); | 270 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg"); |
278 | pcie->reg_base = devm_ioremap_resource(dev, res); | 271 | pcie->reg_base = devm_ioremap_resource(dev, res); |
279 | if (IS_ERR(pcie->reg_base)) { | 272 | if (IS_ERR(pcie->reg_base)) { |
diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index a939e8d31735..77052a0712d0 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c | |||
@@ -301,13 +301,6 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) | |||
301 | struct platform_device *pdev = pcie->pdev; | 301 | struct platform_device *pdev = pcie->pdev; |
302 | struct device_node *node = dev->of_node; | 302 | struct device_node *node = dev->of_node; |
303 | struct resource *res; | 303 | struct resource *res; |
304 | const char *type; | ||
305 | |||
306 | type = of_get_property(node, "device_type", NULL); | ||
307 | if (!type || strcmp(type, "pci")) { | ||
308 | dev_err(dev, "invalid \"device_type\" %s\n", type); | ||
309 | return -EINVAL; | ||
310 | } | ||
311 | 304 | ||
312 | /* map config resource */ | 305 | /* map config resource */ |
313 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, | 306 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, |
diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c index fb32840ce8e6..81538d77f790 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c | |||
@@ -777,16 +777,7 @@ static int nwl_pcie_parse_dt(struct nwl_pcie *pcie, | |||
777 | struct platform_device *pdev) | 777 | struct platform_device *pdev) |
778 | { | 778 | { |
779 | struct device *dev = pcie->dev; | 779 | struct device *dev = pcie->dev; |
780 | struct device_node *node = dev->of_node; | ||
781 | struct resource *res; | 780 | struct resource *res; |
782 | const char *type; | ||
783 | |||
784 | /* Check for device type */ | ||
785 | type = of_get_property(node, "device_type", NULL); | ||
786 | if (!type || strcmp(type, "pci")) { | ||
787 | dev_err(dev, "invalid \"device_type\" %s\n", type); | ||
788 | return -EINVAL; | ||
789 | } | ||
790 | 781 | ||
791 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "breg"); | 782 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "breg"); |
792 | pcie->breg_base = devm_ioremap_resource(dev, res); | 783 | pcie->breg_base = devm_ioremap_resource(dev, res); |
diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c index 7b1389d8e2a5..9bd1a35cd5d8 100644 --- a/drivers/pci/controller/pcie-xilinx.c +++ b/drivers/pci/controller/pcie-xilinx.c | |||
@@ -574,15 +574,8 @@ static int xilinx_pcie_parse_dt(struct xilinx_pcie_port *port) | |||
574 | struct device *dev = port->dev; | 574 | struct device *dev = port->dev; |
575 | struct device_node *node = dev->of_node; | 575 | struct device_node *node = dev->of_node; |
576 | struct resource regs; | 576 | struct resource regs; |
577 | const char *type; | ||
578 | int err; | 577 | int err; |
579 | 578 | ||
580 | type = of_get_property(node, "device_type", NULL); | ||
581 | if (!type || strcmp(type, "pci")) { | ||
582 | dev_err(dev, "invalid \"device_type\" %s\n", type); | ||
583 | return -EINVAL; | ||
584 | } | ||
585 | |||
586 | err = of_address_to_resource(node, 0, ®s); | 579 | err = of_address_to_resource(node, 0, ®s); |
587 | if (err) { | 580 | if (err) { |
588 | dev_err(dev, "missing \"reg\" property\n"); | 581 | dev_err(dev, "missing \"reg\" property\n"); |