mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PM / Domains: Not return error when dev_pm_get_subsys_data returns 1
@ 2012-08-07  9:04 Tushar Behera
  2012-08-07 11:47 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Tushar Behera @ 2012-08-07  9:04 UTC (permalink / raw)
  To: linux-pm, linux-kernel; +Cc: len.brown, pavel, rjw, patches

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-07 11:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-07  9:04 [PATCH] PM / Domains: Not return error when dev_pm_get_subsys_data returns 1 Tushar Behera
2012-08-07 11:47 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®