Skip to content

Commit ac338ac

Browse files
Saravana Kannangregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 21eb93f commit ac338ac

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/linux/device.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,17 @@ static inline struct device_node *dev_of_node(struct device *dev)
798798
return dev->of_node;
799799
}
800800

801+
static inline bool dev_has_sync_state(struct device *dev)
802+
{
803+
if (!dev)
804+
return false;
805+
if (dev->driver && dev->driver->sync_state)
806+
return true;
807+
if (dev->bus && dev->bus->sync_state)
808+
return true;
809+
return false;
810+
}
811+
801812
/*
802813
* High level routines for use by the bus drivers
803814
*/

0 commit comments

Comments
 (0)