[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200221075036.181885-3-saravanak@google.com>
Date: Thu, 20 Feb 2020 23:50:35 -0800
From: Saravana Kannan <saravanak@...gle.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>
Cc: Saravana Kannan <saravanak@...gle.com>, kernel-team@...roid.com,
linux-kernel@...r.kernel.org
Subject: [PATCH v1 2/3] driver core: Add dev_has_sync_state()
Add an API to check if a device has sync_state support in its driver or
bus.
Signed-off-by: Saravana Kannan <saravanak@...gle.com>
---
include/linux/device.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/linux/device.h b/include/linux/device.h
index 0cd7c647c16c..fa04dfd22bbc 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -798,6 +798,17 @@ static inline struct device_node *dev_of_node(struct device *dev)
return dev->of_node;
}
+static inline bool dev_has_sync_state(struct device *dev)
+{
+ if (!dev)
+ return false;
+ if (dev->driver && dev->driver->sync_state)
+ return true;
+ if (dev->bus && dev->bus->sync_state)
+ return true;
+ return false;
+}
+
/*
* High level routines for use by the bus drivers
*/
--
2.25.0.265.gbab2e86ba0-goog
Powered by blists - more mailing lists