diff mbox

PM / Domains: Not return error when dev_pm_get_subsys_data returns 1

Message ID 1344330256-6939-1-git-send-email-tushar.behera@linaro.org
State Accepted
Headers show

Commit Message

Tushar Behera Aug. 7, 2012, 9:04 a.m. UTC
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 mbox

Patch

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;
 }
 
 /**