@@ -402,6 +402,9 @@ static struct scp *init_scp(struct platform_device *pdev,
struct scp_domain *scpd = &scp->domains[i];
const struct scp_domain_data *data = &scp_domain_data[i];
+ if (!data->name)
+ continue;
+
scpd->supply = devm_regulator_get_optional(&pdev->dev, data->name);
if (IS_ERR(scpd->supply)) {
if (PTR_ERR(scpd->supply) == -ENODEV)
@@ -420,6 +423,9 @@ static struct scp *init_scp(struct platform_device *pdev,
struct generic_pm_domain *genpd = &scpd->genpd;
const struct scp_domain_data *data = &scp_domain_data[i];
+ if (!data->name)
+ continue;
+
pd_data->domains[i] = genpd;
scpd->scp = scp;
@@ -457,6 +463,9 @@ static void mtk_register_power_domains(struct platform_device *pdev,
struct scp_domain *scpd = &scp->domains[i];
struct generic_pm_domain *genpd = &scpd->genpd;
+ if (!genpd->name)
+ continue;
+
/*
* Initially turn on all domains to make the domains usable
* with !CONFIG_PM and to get the hardware in sync with the
The power domains array for MT6797 contains gaps, since most MFG-related power domains are missing. This causes a lookup for a regulator with a NULL name fail, and this will cause the probe of SCPSYS to fail. This patch skips gaps in the array by detecting if the power domain name is NULL. This could all be easily solved by reordering the #defines in dt-bindings, but that could break existing DTBs. Signed-off-by: Jasper Mattsson <jasu@njomotys.info> --- drivers/soc/mediatek/mtk-scpsys.c | 9 +++++++++ 1 file changed, 9 insertions(+)