Re: [linux-pm] [PATCH 2/2] i2c: Factor out runtime suspend checksfrom PM operations

From: Rabin Vincent
Date: Wed Dec 22 2010 - 10:10:31 EST


On Mon, Dec 20, 2010 at 8:03 PM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>  static int i2c_device_pm_restore(struct device *dev)
> @@ -267,7 +248,7 @@ static int i2c_device_pm_restore(struct device *dev)
>        int ret;
>
>        if (pm)
> -               ret = pm->restore ? pm->restore(dev) : 0;
> +               ret = pm_generic_restore(dev);
>        else
>                ret = i2c_legacy_resume(dev);

The full function is:

static int i2c_device_pm_restore(struct device *dev)
{
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
int ret;

if (pm)
ret = pm->restore ? pm->restore(dev) : 0;
else
ret = i2c_legacy_resume(dev);

if (!ret) {
pm_runtime_disable(dev);
pm_runtime_set_active(dev);
pm_runtime_enable(dev);
}

return ret;
}

Shouldn't you be deleting the pm_runtime_* stuff from here? There is
already done in pm_generic_restore() iff the callback exists and returns
zero.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/