[bug report] soc: mediatek: pm-domains: Don't print an error if child domain is deferred

Dan Carpenter dan.carpenter at oracle.com
Mon Feb 15 03:48:35 EST 2021


Hello Enric Balletbo i Serra,

The patch dd65030295e2: "soc: mediatek: pm-domains: Don't print an
error if child domain is deferred" from Jan 13, 2021, leads to the
following static checker warning:

	drivers/soc/mediatek/mtk-pm-domains.c:492 scpsys_add_subdomain()
	warn: missing error code here? 'IS_ERR()' failed. 'ret' = '0'

drivers/soc/mediatek/mtk-pm-domains.c
   485  
   486                  parent_pd = scpsys->pd_data.domains[id];
   487  
   488                  child_pd = scpsys_add_one_domain(scpsys, child);
   489                  if (IS_ERR(child_pd)) {
   490                          dev_err_probe(scpsys->dev, PTR_ERR(child_pd),
   491                                        "%pOF: failed to get child domain id\n", child);
   492                          goto err_put_node;

The patch was trying to return success if PTR_ERR(child_pd) == -EPROBE_DEFER
but instead it always returns success.  Shouldn't it just be something
like:
				ret = PTR_ERR(child_pd);
				if (ret == -EPROBE_DEFER)
					ret = 0;

   493                  }
   494  
   495                  ret = pm_genpd_add_subdomain(parent_pd, child_pd);
   496                  if (ret) {
   497                          dev_err(scpsys->dev, "failed to add %s subdomain to parent %s\n",
   498                                  child_pd->name, parent_pd->name);
   499                          goto err_put_node;
   500                  } else {
   501                          dev_dbg(scpsys->dev, "%s add subdomain: %s\n", parent_pd->name,
   502                                  child_pd->name);
   503                  }
   504  
   505                  /* recursive call to add all subdomains */
   506                  ret = scpsys_add_subdomain(scpsys, child);
   507                  if (ret)
   508                          goto err_put_node;
   509          }
   510  
   511          return 0;
   512  
   513  err_put_node:
   514          of_node_put(child);
   515          return ret;
   516  }

regards,
dan carpenter



More information about the linux-arm-kernel mailing list