Skip to content

Commit 0c1ddc7

Browse files
wensstorulf
authored andcommitted
pmdomain: mediatek: Add error messages for missing regmaps
A recent change to the syscon regmap API caused the MediaTek power controller drivers to fail, as the required regmap could no longer be retrieved. The error did not have an accompanying message, making the failure less obvious. The aforementioned change has since been reverted. Add error messages to all the regmap retrievals, thereby making all error paths in scpsys_add_one_domain() have visible error messages. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20250421090951.395467-1-wenst@chromium.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 359a8ff commit 0c1ddc7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/pmdomain/mediatek/mtk-pm-domains.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,20 +398,26 @@ generic_pm_domain *scpsys_add_one_domain(struct scpsys *scpsys, struct device_no
398398

399399
pd->infracfg = syscon_regmap_lookup_by_phandle_optional(node, "mediatek,infracfg");
400400
if (IS_ERR(pd->infracfg))
401-
return ERR_CAST(pd->infracfg);
401+
return dev_err_cast_probe(scpsys->dev, pd->infracfg,
402+
"%pOF: failed to get infracfg regmap\n",
403+
node);
402404

403405
smi_node = of_parse_phandle(node, "mediatek,smi", 0);
404406
if (smi_node) {
405407
pd->smi = device_node_to_regmap(smi_node);
406408
of_node_put(smi_node);
407409
if (IS_ERR(pd->smi))
408-
return ERR_CAST(pd->smi);
410+
return dev_err_cast_probe(scpsys->dev, pd->smi,
411+
"%pOF: failed to get SMI regmap\n",
412+
node);
409413
}
410414

411415
if (MTK_SCPD_CAPS(pd, MTK_SCPD_HAS_INFRA_NAO)) {
412416
pd->infracfg_nao = syscon_regmap_lookup_by_phandle(node, "mediatek,infracfg-nao");
413417
if (IS_ERR(pd->infracfg_nao))
414-
return ERR_CAST(pd->infracfg_nao);
418+
return dev_err_cast_probe(scpsys->dev, pd->infracfg_nao,
419+
"%pOF: failed to get infracfg-nao regmap\n",
420+
node);
415421
} else {
416422
pd->infracfg_nao = NULL;
417423
}

0 commit comments

Comments
 (0)