Commit de17c520 authored by Rob Herring's avatar Rob Herring Committed by Lorenzo Pieralisi

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: default avatarRob Herring <robh@kernel.org>
[lorenzo.pieralisi@arm.com: reformatted the log]
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: default avatarAlan Douglas <adouglas@cadence.com>
Acked-by: default avatarSubrahmaya Lingappa <l.subrahmanya@mobiveil.co.in>
Acked-by: default avatarMichal 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
parent 7876320f
...@@ -58,9 +58,7 @@ static struct pci_config_window *gen_pci_init(struct device *dev, ...@@ -58,9 +58,7 @@ static struct pci_config_window *gen_pci_init(struct device *dev,
int pci_host_common_probe(struct platform_device *pdev, int pci_host_common_probe(struct platform_device *pdev,
struct pci_ecam_ops *ops) struct pci_ecam_ops *ops)
{ {
const char *type;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
struct pci_host_bridge *bridge; struct pci_host_bridge *bridge;
struct pci_config_window *cfg; struct pci_config_window *cfg;
struct list_head resources; struct list_head resources;
...@@ -70,12 +68,6 @@ int pci_host_common_probe(struct platform_device *pdev, ...@@ -70,12 +68,6 @@ int pci_host_common_probe(struct platform_device *pdev,
if (!bridge) if (!bridge)
return -ENOMEM; return -ENOMEM;
type = of_get_property(np, "device_type", NULL);
if (!type || strcmp(type, "pci")) {
dev_err(dev, "invalid \"device_type\" %s\n", type);
return -EINVAL;
}
of_pci_check_probe_only(); of_pci_check_probe_only();
/* Parse and map our Configuration Space windows */ /* Parse and map our Configuration Space windows */
......
...@@ -235,7 +235,6 @@ static int cdns_pcie_host_init(struct device *dev, ...@@ -235,7 +235,6 @@ static int cdns_pcie_host_init(struct device *dev,
static int cdns_pcie_host_probe(struct platform_device *pdev) static int cdns_pcie_host_probe(struct platform_device *pdev)
{ {
const char *type;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
struct pci_host_bridge *bridge; struct pci_host_bridge *bridge;
...@@ -268,12 +267,6 @@ static int cdns_pcie_host_probe(struct platform_device *pdev) ...@@ -268,12 +267,6 @@ static int cdns_pcie_host_probe(struct platform_device *pdev)
rc->device_id = 0xffff; rc->device_id = 0xffff;
of_property_read_u16(np, "device-id", &rc->device_id); of_property_read_u16(np, "device-id", &rc->device_id);
type = of_get_property(np, "device_type", NULL);
if (!type || strcmp(type, "pci")) {
dev_err(dev, "invalid \"device_type\" %s\n", type);
return -EINVAL;
}
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg");
pcie->reg_base = devm_ioremap_resource(dev, res); pcie->reg_base = devm_ioremap_resource(dev, res);
if (IS_ERR(pcie->reg_base)) { if (IS_ERR(pcie->reg_base)) {
......
...@@ -301,13 +301,6 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) ...@@ -301,13 +301,6 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie)
struct platform_device *pdev = pcie->pdev; struct platform_device *pdev = pcie->pdev;
struct device_node *node = dev->of_node; struct device_node *node = dev->of_node;
struct resource *res; struct resource *res;
const char *type;
type = of_get_property(node, "device_type", NULL);
if (!type || strcmp(type, "pci")) {
dev_err(dev, "invalid \"device_type\" %s\n", type);
return -EINVAL;
}
/* map config resource */ /* map config resource */
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
......
...@@ -777,16 +777,7 @@ static int nwl_pcie_parse_dt(struct nwl_pcie *pcie, ...@@ -777,16 +777,7 @@ static int nwl_pcie_parse_dt(struct nwl_pcie *pcie,
struct platform_device *pdev) struct platform_device *pdev)
{ {
struct device *dev = pcie->dev; struct device *dev = pcie->dev;
struct device_node *node = dev->of_node;
struct resource *res; struct resource *res;
const char *type;
/* Check for device type */
type = of_get_property(node, "device_type", NULL);
if (!type || strcmp(type, "pci")) {
dev_err(dev, "invalid \"device_type\" %s\n", type);
return -EINVAL;
}
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "breg"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "breg");
pcie->breg_base = devm_ioremap_resource(dev, res); pcie->breg_base = devm_ioremap_resource(dev, res);
......
...@@ -574,15 +574,8 @@ static int xilinx_pcie_parse_dt(struct xilinx_pcie_port *port) ...@@ -574,15 +574,8 @@ static int xilinx_pcie_parse_dt(struct xilinx_pcie_port *port)
struct device *dev = port->dev; struct device *dev = port->dev;
struct device_node *node = dev->of_node; struct device_node *node = dev->of_node;
struct resource regs; struct resource regs;
const char *type;
int err; int err;
type = of_get_property(node, "device_type", NULL);
if (!type || strcmp(type, "pci")) {
dev_err(dev, "invalid \"device_type\" %s\n", type);
return -EINVAL;
}
err = of_address_to_resource(node, 0, &regs); err = of_address_to_resource(node, 0, &regs);
if (err) { if (err) {
dev_err(dev, "missing \"reg\" property\n"); dev_err(dev, "missing \"reg\" property\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment