Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Rob Herring and committed by
Lorenzo Pieralisi
de17c520 7876320f

-38
-8
drivers/pci/controller/pci-host-common.c
··· 58 58 int pci_host_common_probe(struct platform_device *pdev, 59 59 struct pci_ecam_ops *ops) 60 60 { 61 - const char *type; 62 61 struct device *dev = &pdev->dev; 63 - struct device_node *np = dev->of_node; 64 62 struct pci_host_bridge *bridge; 65 63 struct pci_config_window *cfg; 66 64 struct list_head resources; ··· 67 69 bridge = devm_pci_alloc_host_bridge(dev, 0); 68 70 if (!bridge) 69 71 return -ENOMEM; 70 - 71 - type = of_get_property(np, "device_type", NULL); 72 - if (!type || strcmp(type, "pci")) { 73 - dev_err(dev, "invalid \"device_type\" %s\n", type); 74 - return -EINVAL; 75 - } 76 72 77 73 of_pci_check_probe_only(); 78 74
-7
drivers/pci/controller/pcie-cadence-host.c
··· 235 235 236 236 static int cdns_pcie_host_probe(struct platform_device *pdev) 237 237 { 238 - const char *type; 239 238 struct device *dev = &pdev->dev; 240 239 struct device_node *np = dev->of_node; 241 240 struct pci_host_bridge *bridge; ··· 266 267 267 268 rc->device_id = 0xffff; 268 269 of_property_read_u16(np, "device-id", &rc->device_id); 269 - 270 - type = of_get_property(np, "device_type", NULL); 271 - if (!type || strcmp(type, "pci")) { 272 - dev_err(dev, "invalid \"device_type\" %s\n", type); 273 - return -EINVAL; 274 - } 275 270 276 271 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg"); 277 272 pcie->reg_base = devm_ioremap_resource(dev, res);
-7
drivers/pci/controller/pcie-mobiveil.c
··· 301 301 struct platform_device *pdev = pcie->pdev; 302 302 struct device_node *node = dev->of_node; 303 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 305 /* map config resource */ 313 306 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-9
drivers/pci/controller/pcie-xilinx-nwl.c
··· 777 777 struct platform_device *pdev) 778 778 { 779 779 struct device *dev = pcie->dev; 780 - struct device_node *node = dev->of_node; 781 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 782 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "breg"); 792 783 pcie->breg_base = devm_ioremap_resource(dev, res);
-7
drivers/pci/controller/pcie-xilinx.c
··· 574 574 struct device *dev = port->dev; 575 575 struct device_node *node = dev->of_node; 576 576 struct resource regs; 577 - const char *type; 578 577 int err; 579 - 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 578 586 579 err = of_address_to_resource(node, 0, &regs); 587 580 if (err) {