[PATCH/RFC] via-pmu: remove mdelays from suspend/resume code

Johannes Berg johannes at sipsolutions.net
Fri Apr 4 02:44:44 EST 2008


I don't see a reason for either of those mdelay()s, is there any? Works
fine for me without them...

johannes
---
 drivers/macintosh/via-pmu.c |   20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

--- everything.orig/drivers/macintosh/via-pmu.c	2008-04-03 17:27:29.000000000 +0200
+++ everything/drivers/macintosh/via-pmu.c	2008-04-03 17:28:23.000000000 +0200
@@ -2165,8 +2165,6 @@ static void pmac_suspend_disable_irqs(vo
 
 static int powerbook_sleep(suspend_state_t state)
 {
-	int error = 0;
-
 	/* Wait for completion of async requests */
 	while (!batt_req.complete)
 		pmu_poll();
@@ -2183,25 +2181,15 @@ static int powerbook_sleep(suspend_state
 
 	switch (pmu_kind) {
 	case PMU_OHARE_BASED:
-		error = powerbook_sleep_3400();
-		break;
+		return powerbook_sleep_3400();
 	case PMU_HEATHROW_BASED:
 	case PMU_PADDINGTON_BASED:
-		error = powerbook_sleep_grackle();
-		break;
+		return powerbook_sleep_grackle();
 	case PMU_KEYLARGO_BASED:
-		error = powerbook_sleep_Core99();
-		break;
+		return powerbook_sleep_Core99();
 	default:
 		return -ENOSYS;
 	}
-
-	if (error)
-		return error;
-
-	mdelay(100);
-
-	return 0;
 }
 
 static void pmac_suspend_enable_irqs(void)
@@ -2210,8 +2198,6 @@ static void pmac_suspend_enable_irqs(voi
 	adb_int_pending = 1;
 	via_pmu_interrupt(0, NULL);
 
-	mdelay(10);
-
 	/* Call platform functions marked "on wake" */
 	pmac_pfunc_base_resume();
 	pmac_pfunc_i2c_resume();





More information about the Linuxppc-dev mailing list