All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "Heiko Stübner" <heiko@sntech.de>
Cc: Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PM / Domains: Only check for errors when calling dev_pm_get_subsys_data
Date: Sun, 5 Aug 2012 23:13:46 +0200	[thread overview]
Message-ID: <201208052313.47024.rjw@sisk.pl> (raw)
In-Reply-To: <201208052225.09503.heiko@sntech.de>

On Sunday, August 05, 2012, Heiko Stübner wrote:
> Commit 1d5fcfec22 (PM / Domains: Add device domain data reference counter)
> added a check for the return value of dev_pm_get_subsys_data.
> 
> But this function does not only return error codes but also "1" when a
> new object has been created.
> 
> So, change the check to only catch real errors.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>

Good catch!

Applied to the linux-next branch of the linux-pm.git tree.  I'm going to
push it as a fix for v3.6.

However, there's one more analogous fix necessary, for which I'm going to
apply the appended patch.

Thanks,
Rafael


---
From: Rafael J. Wysocki <rjw@sisk.pl>
Subject: PM / Domains: Fix one more dev_pm_get_subsys_data() return value check

The check agains the return value of dev_pm_get_subsys_data()
in pm_genpd_add_callbacks() should be modified so that non-negative
values are not regarded as errors, because dev_pm_get_subsys_data()
returns 1 if it successfully creates a new object.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/base/power/domain.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/drivers/base/power/domain.c
===================================================================
--- linux.orig/drivers/base/power/domain.c
+++ linux/drivers/base/power/domain.c
@@ -1691,7 +1691,7 @@ int pm_genpd_add_callbacks(struct device
 	device_pm_lock();
 
 	ret = dev_pm_get_subsys_data(dev);
-	if (ret)
+	if (ret < 0)
 		goto out;
 
 	spin_lock_irq(&dev->power.lock);

  reply	other threads:[~2012-08-05 21:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-05 20:25 [PATCH] PM / Domains: Only check for errors when calling dev_pm_get_subsys_data Heiko Stübner
2012-08-05 21:13 ` Rafael J. Wysocki [this message]
2012-08-05 21:50   ` Heiko Stübner

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=201208052313.47024.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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.