Thread (45 messages) 45 messages, 3 authors, 2011-09-22
STALE5365d REVIEWED: 1 (0M)
Revisions (5)
  1. v6 [diff vs current]
  2. v7 current
  3. v8 [diff vs current]
  4. v9 [diff vs current]
  5. v9 [diff vs current]

[PATCH v7 20/26] gpio/omap: skip operations in runtime callbacks

From: Tarun Kanti DebBarma <hidden>
Date: 2011-09-13 13:02:53
Also in: linux-omap
Subsystem: gpio subsystem, omap gpio driver, the rest · Maintainers: Linus Walleij, Bartosz Golaszewski, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman, Linus Torvalds

The *_runtime_suspend/resume() callbacks perform basic operations
necessary before/after turning off/on clocks using *_runtime_put/get*().
This happens when modules are fully initialized and functional.
They don't have to be called during initialization. As we need the clocks
to be turned on/off using *_runtime_get/put*() in *_probe() make sure
we return from these callbacks during this time.

Signed-off-by: Tarun Kanti DebBarma <redacted>
Reviewed-by: Santosh Shilimkar <redacted>
---
 drivers/gpio/gpio-omap.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 8ec9f68..628e42f 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1122,6 +1122,9 @@ static int omap_gpio_runtime_suspend(struct device *dev)
 	int j;
 	unsigned long flags;
 
+	if (!bank->mod_usage)
+		return 0;
+
 	spin_lock_irqsave(&bank->lock, flags);
 	/*
 	 * If going to OFF, remove triggering for all
@@ -1166,6 +1169,9 @@ static int omap_gpio_runtime_resume(struct device *dev)
 	int j;
 	unsigned long flags;
 
+	if (!bank->mod_usage)
+		return 0;
+
 	spin_lock_irqsave(&bank->lock, flags);
 	for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
 		clk_enable(bank->dbck);
-- 
1.7.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help