soc: amlogic: meson-ee-pwrc: propagate errors from pm_genpd_init()
pm_genpd_init() can return an error. Propagate the error code to prevent
the driver from indicating that it successfully probed while there were
errors during pm_genpd_init().
Fixes: eef3c2ba0a
("soc: amlogic: Add support for Everything-Else power domains controller")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
This commit is contained in:
parent
0766d65e6a
commit
c67aafd60d
|
@ -323,6 +323,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
|
|||
struct meson_ee_pwrc *pwrc,
|
||||
struct meson_ee_pwrc_domain *dom)
|
||||
{
|
||||
int ret;
|
||||
|
||||
dom->pwrc = pwrc;
|
||||
dom->num_rstc = dom->desc.reset_names_count;
|
||||
dom->num_clks = dom->desc.clk_names_count;
|
||||
|
@ -368,15 +370,21 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
|
|||
* prepare/enable counters won't be in sync.
|
||||
*/
|
||||
if (dom->num_clks && dom->desc.get_power && !dom->desc.get_power(dom)) {
|
||||
int ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
|
||||
ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pm_genpd_init(&dom->base, &pm_domain_always_on_gov, false);
|
||||
} else
|
||||
pm_genpd_init(&dom->base, NULL,
|
||||
(dom->desc.get_power ?
|
||||
dom->desc.get_power(dom) : true));
|
||||
ret = pm_genpd_init(&dom->base, &pm_domain_always_on_gov,
|
||||
false);
|
||||
if (ret)
|
||||
return ret;
|
||||
} else {
|
||||
ret = pm_genpd_init(&dom->base, NULL,
|
||||
(dom->desc.get_power ?
|
||||
dom->desc.get_power(dom) : true));
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue