lkml.org 
[lkml]   [2018]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/9] PM / core: add helper to return suspend status of a device
Date
I2C core would like this to reject transfers on an already suspended
adapter.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
include/linux/device.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/linux/device.h b/include/linux/device.h
index 1b25c7a43f4c..e63d3e06989f 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1138,6 +1138,11 @@ static inline int device_is_registered(struct device *dev)
return dev->kobj.state_in_sysfs;
}

+static inline bool device_is_suspended(struct device *dev)
+{
+ return dev->power.is_suspended;
+}
+
static inline void device_enable_async_suspend(struct device *dev)
{
if (!dev->power.is_prepared)
--
2.19.1
\
 
 \ /
  Last update: 2018-12-22 21:28    [W:0.124 / U:15.712 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site