Skip to content

Commit 19abcd7

Browse files
kishonLorenzo Pieralisi
authored andcommitted
PCI: cadence: Fix cdns_pcie_{host|ep}_setup() error path
commit bd22885 ("PCI: cadence: Refactor driver to use as a core library") while refactoring the Cadence PCIe driver to be used as library, removed pm_runtime_get_sync() from cdns_pcie_ep_setup() and cdns_pcie_host_setup() but missed to remove the corresponding pm_runtime_put_sync() in the error path. Fix it here. Link: https://lore.kernel.org/r/[email protected] Fixes: bd22885 ("PCI: cadence: Refactor driver to use as a core library") Signed-off-by: Kishon Vijay Abraham I <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Rob Herring <[email protected]>
1 parent 5d3d063 commit 19abcd7

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

drivers/pci/controller/cadence/pcie-cadence-ep.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <linux/of.h>
99
#include <linux/pci-epc.h>
1010
#include <linux/platform_device.h>
11-
#include <linux/pm_runtime.h>
1211
#include <linux/sizes.h>
1312

1413
#include "pcie-cadence.h"
@@ -440,8 +439,7 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep)
440439
epc = devm_pci_epc_create(dev, &cdns_pcie_epc_ops);
441440
if (IS_ERR(epc)) {
442441
dev_err(dev, "failed to create epc device\n");
443-
ret = PTR_ERR(epc);
444-
goto err_init;
442+
return PTR_ERR(epc);
445443
}
446444

447445
epc_set_drvdata(epc, ep);
@@ -453,7 +451,7 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep)
453451
resource_size(pcie->mem_res), PAGE_SIZE);
454452
if (ret < 0) {
455453
dev_err(dev, "failed to initialize the memory space\n");
456-
goto err_init;
454+
return ret;
457455
}
458456

459457
ep->irq_cpu_addr = pci_epc_mem_alloc_addr(epc, &ep->irq_phys_addr,
@@ -472,8 +470,5 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep)
472470
free_epc_mem:
473471
pci_epc_mem_exit(epc);
474472

475-
err_init:
476-
pm_runtime_put_sync(dev);
477-
478473
return ret;
479474
}

drivers/pci/controller/cadence/pcie-cadence-host.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <linux/of_address.h>
99
#include <linux/of_pci.h>
1010
#include <linux/platform_device.h>
11-
#include <linux/pm_runtime.h>
1211

1312
#include "pcie-cadence.h"
1413

@@ -474,7 +473,7 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc)
474473

475474
ret = cdns_pcie_host_init(dev, &resources, rc);
476475
if (ret)
477-
goto err_init;
476+
return ret;
478477

479478
list_splice_init(&resources, &bridge->windows);
480479
bridge->dev.parent = dev;
@@ -492,8 +491,5 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc)
492491
err_host_probe:
493492
pci_free_resource_list(&resources);
494493

495-
err_init:
496-
pm_runtime_put_sync(dev);
497-
498494
return ret;
499495
}

0 commit comments

Comments
 (0)