[PATCH 3/8] device: Add generic device_{suspend, resume}() API


dirk.brandewie@...
 

From: Dirk Brandewie <dirk.j.brandewie(a)intel.com>

Provide an API to call the device suspend/resume functions.

Change-Id: I352481897a4bf431fc9eb78540fc81f5e552c4be
Signed-off-by: Dirk Brandewie <dirk.j.brandewie(a)intel.com>
---
include/device.h | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/include/device.h b/include/device.h
index 5dbb52f..40adbe8 100644
--- a/include/device.h
+++ b/include/device.h
@@ -266,6 +266,16 @@ static inline int _null_suspend_resume(struct device *device)
return 0;
};

+static inline int device_suspend(struct device *device)
+{
+ return device->config->dev_ops->suspend(device);
+}
+
+static inline int device_resume(struct device *device)
+{
+ return device->config->dev_ops->resume(device);
+}
+
/**
* Synchronous calls API
*/
--
2.4.3