Commit 6d88283a authored by Saravana Kannan's avatar Saravana Kannan Committed by Greg Kroah-Hartman

driver core: Add dev_has_sync_state()

commit ac338acf upstream.

Add an API to check if a device has sync_state support in its driver or
bus.
Signed-off-by: default avatarSaravana Kannan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: Davide Caratti <[email protected]>
Signed-off-by: default avatarGreg Kroah-Hartman <[email protected]>
parent 7a5ab694
...@@ -1522,6 +1522,17 @@ static inline struct device_node *dev_of_node(struct device *dev) ...@@ -1522,6 +1522,17 @@ static inline struct device_node *dev_of_node(struct device *dev)
void driver_init(void); void driver_init(void);
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 * High level routines for use by the bus drivers
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment