summaryrefslogtreecommitdiffstats
path: root/drivers/pmdomain
diff options
context:
space:
mode:
authorHongbo Li <lihongbo22@huawei.com>2024-08-28 14:12:30 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2024-09-13 12:48:34 +0200
commit391a2e64d757a0d22a99676930b5aee29f4a4f35 (patch)
tree920a06dc9cac597c37e486b3afeba12bcd076594 /drivers/pmdomain
parentpmdomain: imx93-pd: drop the context variable "init_off" (diff)
downloadlinux-391a2e64d757a0d22a99676930b5aee29f4a4f35.tar.xz
linux-391a2e64d757a0d22a99676930b5aee29f4a4f35.zip
pmdomain: mediatek: make use of dev_err_cast_probe()
Using dev_err_cast_probe() to simplify the code. Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Link: https://lore.kernel.org/r/20240828121230.3696315-1-lihongbo22@huawei.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/pmdomain')
-rw-r--r--drivers/pmdomain/mediatek/mtk-pm-domains.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pmdomain/mediatek/mtk-pm-domains.c b/drivers/pmdomain/mediatek/mtk-pm-domains.c
index e274e3315fe7..88406e9ac63c 100644
--- a/drivers/pmdomain/mediatek/mtk-pm-domains.c
+++ b/drivers/pmdomain/mediatek/mtk-pm-domains.c
@@ -398,12 +398,10 @@ generic_pm_domain *scpsys_add_one_domain(struct scpsys *scpsys, struct device_no
scpsys->dev->of_node = node;
pd->supply = devm_regulator_get(scpsys->dev, "domain");
scpsys->dev->of_node = root_node;
- if (IS_ERR(pd->supply)) {
- dev_err_probe(scpsys->dev, PTR_ERR(pd->supply),
+ if (IS_ERR(pd->supply))
+ return dev_err_cast_probe(scpsys->dev, pd->supply,
"%pOF: failed to get power supply.\n",
node);
- return ERR_CAST(pd->supply);
- }
}
pd->infracfg = syscon_regmap_lookup_by_phandle_optional(node, "mediatek,infracfg");