From dfaf6a57974f5b4bcdc2a2a347b192573ffb5135 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Wed, 12 Aug 2020 11:55:46 +0200 Subject: CONFIG_NR_DRAM_BANKS: Remove unreferenced code as its always defined Since commit 86cf1c82850f ("configs: Migrate CONFIG_NR_DRAM_BANKS") & commit 999a772d9f24 ("Kconfig: Migrate CONFIG_NR_DRAM_BANKS"), CONFIG_NR_DRAM_BANKS is always defined with a value (4 is default). It makes no sense to still carry code that is guarded with "#ifndef CONFIG_NR_DRAM_BANKS" (and similar). This patch removes all these unreferenced code paths. Signed-off-by: Stefan Roese Reviewed-by: Pali Rohár Reviewed-by: Andy Shevchenko Reviewed-by: Bin Meng --- drivers/pci/pci-uclass.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/pci') diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index d8a6647a1da..eb07d253011 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -911,8 +911,8 @@ static void decode_regions(struct pci_controller *hose, ofnode parent_node, ofnode node) { int pci_addr_cells, addr_cells, size_cells; - struct bd_info *bd = gd->bd; int cells_per_record; + struct bd_info *bd; const u32 *prop; int max_regions; int len; @@ -989,6 +989,7 @@ static void decode_regions(struct pci_controller *hose, ofnode parent_node, } /* Add a region for our local memory */ + bd = gd->bd; if (!bd) return; -- cgit v1.2.3 From df85e9576c18e868c7d42c224a0967cd31f489c0 Mon Sep 17 00:00:00 2001 From: Chuanjia Liu Date: Mon, 31 Aug 2020 15:53:12 +0800 Subject: PCI: mediatek: Release the resource when PCIe enable port fail On the mt7623 platform, if one port enable fail and other port enable succeed. It will hang on when using pci enum because the resource was not released correctly. Signed-off-by: Chuanjia Liu Tested-by: Frank Wunderlich --- drivers/pci/pcie_mediatek.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'drivers/pci') diff --git a/drivers/pci/pcie_mediatek.c b/drivers/pci/pcie_mediatek.c index ad34f7c597e..55b6a40f254 100644 --- a/drivers/pci/pcie_mediatek.c +++ b/drivers/pci/pcie_mediatek.c @@ -443,29 +443,36 @@ static void mtk_pcie_enable_port(struct mtk_pcie_port *port) err = clk_enable(&port->sys_ck); if (err) - goto exit; + goto err_sys_clk; err = reset_assert(&port->reset); if (err) - goto exit; + goto err_reset; err = reset_deassert(&port->reset); if (err) - goto exit; + goto err_reset; err = generic_phy_init(&port->phy); if (err) - goto exit; + goto err_phy_init; err = generic_phy_power_on(&port->phy); if (err) - goto exit; + goto err_phy_on; if (!mtk_pcie_startup_port(port)) return; pr_err("Port%d link down\n", port->slot); -exit: + + generic_phy_power_off(&port->phy); +err_phy_on: + generic_phy_exit(&port->phy); +err_phy_init: +err_reset: + clk_disable(&port->sys_ck); +err_sys_clk: mtk_pcie_port_free(port); } -- cgit v1.2.3