int i, ret = 0;
u32 pxx_req;
- regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING,
- domain->bits.map, domain->bits.map);
-
if (has_regulator && on) {
ret = regulator_enable(domain->regulator);
if (ret) {
dev_err(domain->dev, "failed to enable regulator\n");
- goto unmap;
+ return ret;
}
}
/* Preserve earlier error code */
ret = ret ?: err;
}
-unmap:
- regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING,
- domain->bits.map, 0);
+
return ret;
}
if (ret)
return dev_err_probe(domain->dev, ret, "Failed to get domain's clocks\n");
+ regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING,
+ domain->bits.map, domain->bits.map);
+
ret = pm_genpd_init(&domain->genpd, NULL, true);
if (ret) {
dev_err(domain->dev, "Failed to init power domain\n");
- goto out_put_clocks;
+ goto out_domain_unmap;
}
ret = of_genpd_add_provider_simple(domain->dev->of_node,
out_genpd_remove:
pm_genpd_remove(&domain->genpd);
-out_put_clocks:
+out_domain_unmap:
+ regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING,
+ domain->bits.map, 0);
imx_pgc_put_clocks(domain);
return ret;
of_genpd_del_provider(domain->dev->of_node);
pm_genpd_remove(&domain->genpd);
+
+ regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING,
+ domain->bits.map, 0);
+
imx_pgc_put_clocks(domain);
return 0;