All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tushar Behera <tushar.behera@linaro.org>
To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: len.brown@intel.com, pavel@ucw.cz, rjw@sisk.pl, patches@linaro.org
Subject: [PATCH] PM / Domains: Not return error when dev_pm_get_subsys_data returns 1
Date: Tue,  7 Aug 2012 14:34:16 +0530	[thread overview]
Message-ID: <1344330256-6939-1-git-send-email-tushar.behera@linaro.org> (raw)

Commit 1d5fcfec22 ("PM / Domains: Add device domain data reference
counter") returns error when dev_pm_get_subsys_data() returns a
non-zero value.

However, dev_pm_get_subsys_data() returns 1 when dev->power.subsys_data
is allocated during this call. Hence we should only check for the error
codes in the return value.

Without this patch, following errors are encountered while adding
devices to powerdomain on Origen board (based on EXYNOS4210).

exynos_pm_add_dev_to_genpd: error in adding exynos4-fb.0 device to pd-lcd0 powerdomain

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/base/power/domain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index ba3487c..f6802cb 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1323,7 +1323,7 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
 		}
 
 	ret = dev_pm_get_subsys_data(dev);
-	if (ret)
+	if (ret < 0)
 		goto out;
 
 	genpd->device_count++;
@@ -1358,7 +1358,7 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev,
 	if (gpd_data != gpd_data_new)
 		__pm_genpd_free_dev_data(dev, gpd_data_new);
 
-	return ret;
+	return (ret < 0) ? : 0;
 }
 
 /**
-- 
1.7.4.1


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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07  9:04 Tushar Behera [this message]
2012-08-07 11:47 ` [PATCH] PM / Domains: Not return error when dev_pm_get_subsys_data returns 1 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=1344330256-6939-1-git-send-email-tushar.behera@linaro.org \
    --to=tushar.behera@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    /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.