aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/host/pci-keystone.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2018-03-20 02:25:07 +0000
committerAlex Shi <alex.shi@linaro.org>2018-03-20 02:25:07 +0000
commit031f431679b03ba7e791dd051fc13f51f806fcd7 (patch)
tree9018f8a4a6c04feaf0180cae915dfe804913ce34 /drivers/pci/host/pci-keystone.c
parentf7901365aa48b20b25f8402e0fd1eea4ac6c55e7 (diff)
parent91db57e54eb9be1560454d6a370d67847b05735f (diff)
Merge remote-tracking branch 'rt-stable/v4.4-rt' into linux-linaro-lsk-v4.4-rtlsk-v4.4-18.03-rt
Diffstat (limited to 'drivers/pci/host/pci-keystone.c')
-rw-r--r--drivers/pci/host/pci-keystone.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c
index 0aa81bd3de12..fb682e8af74d 100644
--- a/drivers/pci/host/pci-keystone.c
+++ b/drivers/pci/host/pci-keystone.c
@@ -179,14 +179,16 @@ static int ks_pcie_get_irq_controller_info(struct keystone_pcie *ks_pcie,
}
/* interrupt controller is in a child node */
- *np_temp = of_find_node_by_name(np_pcie, controller);
+ *np_temp = of_get_child_by_name(np_pcie, controller);
if (!(*np_temp)) {
dev_err(dev, "Node for %s is absent\n", controller);
goto out;
}
temp = of_irq_count(*np_temp);
- if (!temp)
+ if (!temp) {
+ of_node_put(*np_temp);
goto out;
+ }
if (temp > max_host_irqs)
dev_warn(dev, "Too many %s interrupts defined %u\n",
(legacy ? "legacy" : "MSI"), temp);
@@ -200,6 +202,9 @@ static int ks_pcie_get_irq_controller_info(struct keystone_pcie *ks_pcie,
if (!host_irqs[temp])
break;
}
+
+ of_node_put(*np_temp);
+
if (temp) {
*num_irqs = temp;
ret = 0;