lkml.org 
[lkml]   [2013]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] i2c: enable runtime PM for I2C adapter devices enumerated from ACPI
On Mon, Sep 30, 2013 at 07:20:59PM +0200, Rafael J. Wysocki wrote:
> > +static void acpi_i2c_device_pm_get(struct i2c_client *client)
> > +{
> > + struct i2c_adapter *adap = client->adapter;
> > +
> > + /* Make sure the adapter is active */
> > + if (ACPI_HANDLE(adap->dev.parent))
> > + pm_runtime_get_sync(&adap->dev);
> > + if (ACPI_HANDLE(&client->dev))
> > + acpi_dev_pm_attach(&client->dev, true);
>
> It would be sufficient to do
>
> if (ACPI_HANDLE(&client->dev)) {
> pm_runtime_get_sync(&adap->dev);
> acpi_dev_pm_attach(&client->dev, true);
> }
>
> here (and below), because I don't think the client with an ACPI handle and the
> parent without one is extremely unlikely (to the point of non-existence
> actually ;-)). And even if something like that happens, then we only enable
> runtime PM for the adapter if the parent has an ACPI handle, so it still should
> be OK.

OK, I'll change that in the next revision.

> Apart from this the patch looks good to me.

Thanks!


\
 
 \ /
  Last update: 2013-09-30 21:01    [W:0.102 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site