diff options
author | Matt Pedro <mapedro@nvidia.com> | 2014-04-02 16:51:09 -0400 |
---|---|---|
committer | Matthew Pedro <mapedro@nvidia.com> | 2014-04-02 15:46:55 -0700 |
commit | e9674f0d9e0d6170fe424db12ba816357c0afc18 (patch) | |
tree | 625086da3eb36a2cc7286d263e7930704df977c8 /drivers/pci | |
parent | e2671f264c8df106447103f2329d994f4952faa3 (diff) |
Revert "pcie: host: tegra: Fix error exit from probe"
This reverts commit 1d5c438690a6000f11bf4610e4029dcdd6e5b8ba.
This change is causing failures on l4t nvlptest.
Change-Id: Iec560e71c60f1243823807d73d82bc89cb35f9a8
Signed-off-by: Matt Pedro <mapedro@nvidia.com>
Reviewed-on: http://git-master/r/391491
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/host/pci-tegra.c | 73 |
1 files changed, 34 insertions, 39 deletions
diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c index ed8230cc4d13..680f366cddf8 100644 --- a/drivers/pci/host/pci-tegra.c +++ b/drivers/pci/host/pci-tegra.c @@ -1273,36 +1273,6 @@ err_exit: return err; } -static int tegra_pcie_clocks_get(void) -{ - PR_FUNC_LINE; - /* get the PCIEXCLK */ - tegra_pcie.pcie_xclk = clk_get_sys("tegra_pcie", "pciex"); - if (IS_ERR_OR_NULL(tegra_pcie.pcie_xclk)) { - pr_err("%s: unable to get PCIE Xclock\n", __func__); - return -EINVAL; - } - tegra_pcie.pcie_mselect = clk_get_sys("tegra_pcie", "mselect"); - if (IS_ERR_OR_NULL(tegra_pcie.pcie_mselect)) { - pr_err("%s: unable to get PCIE mselect clock\n", __func__); - return -EINVAL; - } - return 0; -} - -static void tegra_pcie_clocks_put(void) -{ - PR_FUNC_LINE; - if (tegra_pcie.pcie_xclk) { - clk_put(tegra_pcie.pcie_xclk); - tegra_pcie.pcie_xclk = NULL; - } - if (tegra_pcie.pcie_mselect) { - clk_put(tegra_pcie.pcie_mselect); - tegra_pcie.pcie_mselect = NULL; - } -} - static int tegra_pcie_power_off(void) { int err = 0; @@ -1320,7 +1290,6 @@ static int tegra_pcie_power_off(void) clk_disable(tegra_pcie.pcie_mselect); if (tegra_pcie.pcie_xclk) clk_disable(tegra_pcie.pcie_xclk); - tegra_pcie_clocks_put(); err = tegra_powergate_partition_with_clk_off(TEGRA_POWERGATE_PCIE); if (err) goto err_exit; @@ -1338,6 +1307,32 @@ err_exit: return err; } +static int tegra_pcie_clocks_get(void) +{ + PR_FUNC_LINE; + /* get the PCIEXCLK */ + tegra_pcie.pcie_xclk = clk_get_sys("tegra_pcie", "pciex"); + if (IS_ERR_OR_NULL(tegra_pcie.pcie_xclk)) { + pr_err("%s: unable to get PCIE Xclock\n", __func__); + return -EINVAL; + } + tegra_pcie.pcie_mselect = clk_get_sys("tegra_pcie", "mselect"); + if (IS_ERR_OR_NULL(tegra_pcie.pcie_mselect)) { + pr_err("%s: unable to get PCIE mselect clock\n", __func__); + return -EINVAL; + } + return 0; +} + +static void tegra_pcie_clocks_put(void) +{ + PR_FUNC_LINE; + if (tegra_pcie.pcie_xclk) + clk_put(tegra_pcie.pcie_xclk); + if (tegra_pcie.pcie_mselect) + clk_put(tegra_pcie.pcie_mselect); +} + static int tegra_pcie_get_resources(void) { int err; @@ -1834,17 +1829,17 @@ static int __init tegra_pcie_init(void) err = tegra_pcie_enable_pads(true); if (err) { pr_err("PCIE: enable pads failed\n"); - goto fail; + return err; } err = tegra_pcie_enable_controller(); if (err) { pr_err("PCIE: enable controller failed\n"); - goto fail; + return err; } err = tegra_pcie_conf_gpios(); if (err) { pr_err("PCIE: configuring gpios failed\n"); - goto fail; + return err; } /* setup the AFI address translations */ tegra_pcie_setup_translations(); @@ -1853,17 +1848,17 @@ static int __init tegra_pcie_init(void) if (tegra_pcie.num_ports) pci_common_init(&tegra_pcie_hw); else { - pr_err("PCIE: no ports detected\n"); - goto fail; + err = tegra_pcie_power_off(); + if (err < 0) { + pr_err("Unable to power off pcie\n"); + return err; + } } tegra_pcie_enable_features(); /* register pcie device as wakeup source */ device_init_wakeup(tegra_pcie.dev, true); return 0; -fail: - tegra_pcie_power_off(); - return err; } static void tegra_pcie_read_plat_data(void) |