lkml.org 
[lkml]   [2018]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 5/5] hwmon: (ina3221) Add PM runtime support
On Wed, Oct 24, 2018 at 09:24:18AM +0000, linux@roeck-us.net wrote:
> > +fail:
> > + if (enable) {
> > + dev_err(dev, "Reverting channel%d enabling: %d\n",
> > + channel, ret);
>
> This message is confusing. Something like "Failed to enable channel %d:
> error %d" would be much better.

Will fix in v3.

> > +fail_pm:
> > + pm_runtime_disable(ina->hdev);
> > + pm_runtime_set_suspended(ina->hdev);
> > + for (i = 0; i < INA3221_NUM_CHANNELS; i++)
> > + pm_runtime_put_noidle(ina->hdev);
>
> The count here doesn't match the count above if some channels
> are disabled, or if the enable loop above aborted.
>
> > + /* Decrease the PM refcount */
> > + for (i = 0; i < INA3221_NUM_CHANNELS; i++)
> > + pm_runtime_put_noidle(ina->hdev);
> >
> As above, this doesn't take disabled channels into account. Maybe that
> doesn't matter; if so, there needs to be a comment indicating that
> negative use counts don't matter. If that is the case, make sure that
> this is acceptable use of the pm API (if it works but is not documented,
> the PM core may change and complain about it at a later time).

The API will stop decrease at 0. But I will see if I can explicitly
loop a matched number, or at lest will mention this in comments.

Thanks
Nicolin

\
 
 \ /
  Last update: 2018-10-24 19:57    [W:0.053 / U:1.388 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site