Re: [PATCH 2/2] power: bq24190_charger: Use PM runtime autosuspend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Liam Breck <liam@xxxxxxxxxxxxxxxxx> [170126 15:57]:
> On Tue, Jan 24, 2017 at 10:29 AM, Tony Lindgren <tony@xxxxxxxxxxx> wrote:
> > @@ -1430,10 +1473,20 @@ static int bq24190_probe(struct i2c_client *client,
> >  static int bq24190_remove(struct i2c_client *client)
> >  {
> >         struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
> > +       int error;
> > +
> > +       error = pm_runtime_get_sync(bdi->dev);
> > +       if (error < 0) {
> > +               dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error);
> > +               pm_runtime_put_noidle(bdi->dev);
> > +       }
> >
> > -       pm_runtime_get_sync(bdi->dev);
> >         bq24190_register_reset(bdi);
> > -       pm_runtime_put_sync(bdi->dev);
> > +
> > +       if (!error) {
> > +               pm_runtime_dont_use_autosuspend(bdi->dev);
> > +               pm_runtime_put_sync(bdi->dev);
> > +       }
> 
> Should put_sync() be called before dont_use_autosuspend(), as in probe()?

Yeah good to have them paired. With pm_runtime_put_noidle() we're
active on error, so we can just call pm_runtime_dont_use_autosuspend()
and pm_runtime_put_sync() unconditionally.

> Should the pm_runtime_disable() further on in remove() go inside the
> above block?

No need to because of the pm_runtime_put_noidle(). I'll just move the
pm_runtime_dont_use_autosuspend() and pm_runtime_put_sync() to the
end.

I'll repost both patches one more time with acks.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux