All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rabin Vincent <rabin@rab.in>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Ben Dooks <ben-linux@fluff.org>,
	Jean Delvare <khali@linux-fr.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Alan Stern <stern@rowland.harvard.edu>,
	linux-pm@lists.linux-foundation.org,
	patches@opensource.wolfsonmicro.com, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [linux-pm] [PATCH 2/2] i2c: Factor out runtime suspend checks from PM operations
Date: Wed, 22 Dec 2010 20:40:23 +0530	[thread overview]
Message-ID: <AANLkTi=KOq65TS299rB=K961=mVXnriyqNxdHzJey5rD@mail.gmail.com> (raw)
In-Reply-To: <1292855593-30608-2-git-send-email-broonie@opensource.wolfsonmicro.com>

On Mon, Dec 20, 2010 at 8:03 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> 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.

WARNING: multiple messages have this Message-ID (diff)
From: Rabin Vincent <rabin-66gdRtMMWGc@public.gmane.org>
To: Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	"Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
	Alan Stern
	<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
	linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [linux-pm] [PATCH 2/2] i2c: Factor out runtime suspend checks from PM operations
Date: Wed, 22 Dec 2010 20:40:23 +0530	[thread overview]
Message-ID: <AANLkTi=KOq65TS299rB=K961=mVXnriyqNxdHzJey5rD@mail.gmail.com> (raw)
In-Reply-To: <1292855593-30608-2-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>

On Mon, Dec 20, 2010 at 8:03 PM, Mark Brown
<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> 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.

  reply	other threads:[~2010-12-22 15:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20 14:33 [PATCH 1/2] PM: Prototype the pm_generic_ operations Mark Brown
2010-12-20 14:33 ` Mark Brown
2010-12-20 14:33 ` [PATCH 2/2] i2c: Factor out runtime suspend checks from PM operations Mark Brown
2010-12-20 14:33 ` Mark Brown
2010-12-22 15:10   ` Rabin Vincent [this message]
2010-12-22 15:10     ` [linux-pm] " Rabin Vincent
2010-12-22 15:25     ` Mark Brown
2010-12-22 15:25       ` Mark Brown
2010-12-22 21:08       ` Rafael J. Wysocki
2010-12-22 21:08         ` Rafael J. Wysocki
2010-12-22 21:08       ` Rafael J. Wysocki
2010-12-22 15:25     ` Mark Brown
2010-12-22 15:10   ` Rabin Vincent
2010-12-20 21:08 ` [PATCH 1/2] PM: Prototype the pm_generic_ operations Rafael J. Wysocki
2010-12-20 21:08 ` Rafael J. Wysocki
2010-12-20 21:08   ` Rafael J. Wysocki
2010-12-22 11:43   ` [linux-pm] " Mark Brown
2010-12-22 11:43     ` Mark Brown
2010-12-22 12:15     ` Rafael J. Wysocki
2010-12-22 12:15       ` Rafael J. Wysocki
2010-12-22 12:19       ` Mark Brown
2010-12-22 12:19       ` [linux-pm] " Mark Brown
2010-12-22 12:19         ` Mark Brown
2010-12-22 12:15     ` Rafael J. Wysocki
2010-12-22 11:43   ` Mark Brown
2010-12-24 14:08 ` Rafael J. Wysocki
2010-12-24 14:08 ` Rafael J. Wysocki
2010-12-24 14:08   ` Rafael J. Wysocki

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='AANLkTi=KOq65TS299rB=K961=mVXnriyqNxdHzJey5rD@mail.gmail.com' \
    --to=rabin@rab.in \
    --cc=ben-linux@fluff.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=khali@linux-fr.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=rjw@sisk.pl \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.