Thread (10 messages) 10 messages, 1 author, 2014-10-13
STALE4260d
Revisions (2)
  1. v1 [diff vs current]
  2. v3 current

[PATCH v3 3/9] amba: Keep PM domain powered during ->probe()

From: Ulf Hansson <hidden>
Date: 2014-10-13 14:02:04
Also in: linux-pm, linux-samsung-soc
Subsystem: arm primecell bus support, the rest · Maintainers: Russell King, Linus Torvalds

To sucessfully probe some devices their corresponding PM domains may
need to be powered.

Use the dev_pm_domain_get|put() APIs, to control the behavior of the PM
domain.

Signed-off-by: Ulf Hansson <redacted>
---
 drivers/amba/bus.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 47bbdc1..a8a8e13 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -187,8 +187,15 @@ static int amba_probe(struct device *dev)
 		if (ret == -EPROBE_DEFER)
 			break;
 
+		ret = dev_pm_domain_get(dev->pm_domain);
+		if (ret) {
+			dev_pm_domain_detach(dev, true);
+			break;
+		}
+
 		ret = amba_get_enable_pclk(pcdev);
 		if (ret) {
+			dev_pm_domain_put(dev->pm_domain);
 			dev_pm_domain_detach(dev, true);
 			break;
 		}
@@ -198,6 +205,7 @@ static int amba_probe(struct device *dev)
 		pm_runtime_enable(dev);
 
 		ret = pcdrv->probe(pcdev, id);
+		dev_pm_domain_put(dev->pm_domain);
 		if (ret == 0)
 			break;
 
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help