diff options
author | Jon Hunter <jonathanh@nvidia.com> | 2016-06-30 11:56:24 +0100 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2016-06-30 13:30:40 +0200 |
commit | c2710ac9f5a8dab4f9bb080713452fe6286ca83d (patch) | |
tree | eaa9761991d0a168f950dacbdd4fc45f2274262b /drivers/soc | |
parent | da8f4b458944dccc371dba240cfa18c27b7b9802 (diff) | |
download | op-kernel-dev-c2710ac9f5a8dab4f9bb080713452fe6286ca83d.zip op-kernel-dev-c2710ac9f5a8dab4f9bb080713452fe6286ca83d.tar.gz |
soc/tegra: pmc: Add specific error messages
When initialising a powergate, only a single error message is shown if
the initialisation fails. Add more error messages to give specific
details of what failed if the initialisation failed and remove the
generic failure message.
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/tegra/pmc.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 2ccbdfe..ecc1ec0 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -792,16 +792,19 @@ error: static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) { struct tegra_powergate *pg; + int id, err; bool off; - int id; pg = kzalloc(sizeof(*pg), GFP_KERNEL); if (!pg) - goto error; + return; id = tegra_powergate_lookup(pmc, np->name); - if (id < 0) + if (id < 0) { + dev_err(pmc->dev, "powergate lookup failed for %s: %d\n", + np->name, id); goto free_mem; + } /* * Clear the bit for this powergate so it cannot be managed @@ -817,16 +820,28 @@ static void tegra_powergate_add(struct tegra_pmc *pmc, struct device_node *np) off = !tegra_powergate_is_powered(pg->id); - if (tegra_powergate_of_get_clks(pg, np)) + err = tegra_powergate_of_get_clks(pg, np); + if (err < 0) { + dev_err(pmc->dev, "failed to get clocks for %s: %d\n", + np->name, err); goto set_available; + } - if (tegra_powergate_of_get_resets(pg, np, off)) + err = tegra_powergate_of_get_resets(pg, np, off); + if (err < 0) { + dev_err(pmc->dev, "failed to get resets for %s: %d\n", + np->name, err); goto remove_clks; + } pm_genpd_init(&pg->genpd, NULL, off); - if (of_genpd_add_provider_simple(np, &pg->genpd)) + err = of_genpd_add_provider_simple(np, &pg->genpd); + if (err < 0) { + dev_err(pmc->dev, "failed to add genpd provider for %s: %d\n", + np->name, err); goto remove_resets; + } dev_dbg(pmc->dev, "added power domain %s\n", pg->genpd.name); @@ -849,9 +864,6 @@ set_available: free_mem: kfree(pg); - -error: - dev_err(pmc->dev, "failed to create power domain for %s\n", np->name); } static void tegra_powergate_init(struct tegra_pmc *pmc) |