forked from luck/tmp_suning_uos_patched
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@google.com> Link: https://lore.kernel.org/r/20200221080510.197337-3-saravanak@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
21eb93f432
commit
ac338acf51
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user