soc: mediatek: pm-domains: Fix missing error code in scpsys_add_subdomain()

Adding one power domain in scpsys_add_subdomain is missing to assign an
error code when it fails. Fix that assigning an error code to 'ret',
this also fixes the follwowing smatch warning.

  drivers/soc/mediatek/mtk-pm-domains.c:492 scpsys_add_subdomain() warn: missing error code 'ret'

Fixes: dd65030295 ("soc: mediatek: pm-domains: Don't print an error if child domain is deferred")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210303091054.796975-1-enric.balletbo@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
This commit is contained in:
Enric Balletbo i Serra 2021-03-03 10:10:54 +01:00 committed by Matthias Brugger
parent 440147639a
commit 9950588a45
1 changed files with 3 additions and 2 deletions

View File

@ -487,8 +487,9 @@ static int scpsys_add_subdomain(struct scpsys *scpsys, struct device_node *paren
child_pd = scpsys_add_one_domain(scpsys, child); child_pd = scpsys_add_one_domain(scpsys, child);
if (IS_ERR(child_pd)) { if (IS_ERR(child_pd)) {
dev_err_probe(scpsys->dev, PTR_ERR(child_pd), ret = PTR_ERR(child_pd);
"%pOF: failed to get child domain id\n", child); dev_err_probe(scpsys->dev, ret, "%pOF: failed to get child domain id\n",
child);
goto err_put_node; goto err_put_node;
} }