>From 491f1dd9972093fddd0b7d27b62c76edcadde707 Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <[email protected]>
Date: Thu, 9 Sep 2010 00:46:16 +0200
Subject: [PATCH 4/7] PM / Runtime: Lenient generic runtime pm callbacks

Allow drivers, that belong to subsystems which use the generic
runtime pm callbacks, not to define runtime pm suspend/resume handlers,
by implicitly assuming success in such cases.

This is needed to eliminate nop handlers that would otherwise be
necessary by drivers which enable runtime pm, but don't need
to do anything when their devices are runtime-suspended/resumed.

Signed-off-by: Ohad Ben-Cohen <[email protected]>
Acked-by: Kevin Hilman <[email protected]>
Acked-by: Mark Brown <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
---
 drivers/base/power/generic_ops.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
index 4b29d49..81f2c84 100644
--- a/drivers/base/power/generic_ops.c
+++ b/drivers/base/power/generic_ops.c
@@ -46,7 +46,7 @@ int pm_generic_runtime_suspend(struct device *dev)
        const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
        int ret;
 
-       ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : -EINVAL;
+       ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : 0;
 
        return ret;
 }
@@ -65,7 +65,7 @@ int pm_generic_runtime_resume(struct device *dev)
        const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
        int ret;
 
-       ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : -EINVAL;
+       ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : 0;
 
        return ret;
 }
-- 
1.7.2.3




Claude BROUAT
UMG/MIPE/WSIV  System Integrator
Office:    +33 (0)1 72 21 04 54
mailto: mailto:[email protected]
Intel Corp. SAS
134, av du Général Eisenhower
BP 73586
31100 TOULOUSE
France



---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to