public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: enric.balletbo@collabora.com
Cc: linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org
Subject: [bug report] soc: mediatek: pm-domains: Don't print an error if child domain is deferred
Date: Mon, 15 Feb 2021 11:48:35 +0300	[thread overview]
Message-ID: <YCo1Y6oA0BDzgk3o@mwanda> (raw)

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

                 reply	other threads:[~2021-02-15  8:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YCo1Y6oA0BDzgk3o@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=enric.balletbo@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox