From: Dan Carpenter <dan.carpenter@oracle.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: rahul.tanwar@linux.intel.com, linux-hwmon@vger.kernel.org
Subject: Re: [bug report] hwmon: Add hardware monitoring driver for Moortec MR75203 PVT controller
Date: Tue, 13 Oct 2020 21:43:42 +0300 [thread overview]
Message-ID: <20201013184342.GV18329@kadam> (raw)
In-Reply-To: <20201013165714.GJ251780@roeck-us.net>
On Tue, Oct 13, 2020 at 09:57:14AM -0700, Guenter Roeck wrote:
> On Tue, Oct 13, 2020 at 05:08:58PM +0300, Dan Carpenter wrote:
> > Hello Rahul Tanwar,
> >
> > The patch 9d823351a337: "hwmon: Add hardware monitoring driver for
> > Moortec MR75203 PVT controller" from Oct 5, 2020, leads to the
> > following static checker warning:
> >
> > drivers/hwmon/mr75203.c:479 pvt_clk_enable()
> > warn: 'pvt->clk' not released on lines: 479.
> >
> > drivers/hwmon/mr75203.c
> > 471 static int pvt_clk_enable(struct device *dev, struct pvt_device *pvt)
> > 472 {
> > 473 int ret;
> > 474
> > 475 ret = clk_prepare_enable(pvt->clk);
> > 476 if (ret)
> > 477 return ret;
> > 478
> > 479 return devm_add_action_or_reset(dev, pvt_clk_disable, pvt);
> >
> > Do we have to disable the clock if devm_add_action_or_reset() fails?
> > This is sort of a new Smatch check so I'm not entirely sure of the rules
> > mysql.
>
> devm_add_action_or_reset calls the callback function (here:
> pvt_clk_disable) if there is an error, and the callback function
> releases the clock. This is a workaround for the missing
> devm_clk_prepare_enable(); you'll find it all over the kernel
> by now.
Ah right. I have seen that before, yes.
regards,
dan carpenter
prev parent reply other threads:[~2020-10-13 18:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-13 14:08 [bug report] hwmon: Add hardware monitoring driver for Moortec MR75203 PVT controller Dan Carpenter
2020-10-13 16:57 ` Guenter Roeck
2020-10-13 18:43 ` Dan Carpenter [this message]
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=20201013184342.GV18329@kadam \
--to=dan.carpenter@oracle.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=rahul.tanwar@linux.intel.com \
/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