summaryrefslogtreecommitdiff
path: root/src/include/device/device.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/device/device.h')
-rw-r--r--src/include/device/device.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h
index cd0999ac94..863299c01d 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -458,6 +458,15 @@ static inline DEVTREE_CONST void *config_of(const struct device *dev)
*/
#define config_of_soc() __pci_0_00_0_config
+static inline bool is_root_device(const struct device *dev)
+{
+ if (!dev || !dev->bus)
+ return false;
+
+ return (dev->path.type == DEVICE_PATH_ROOT) ||
+ (dev->bus->dev == dev);
+}
+
void enable_static_device(struct device *dev);
void enable_static_devices(struct device *bus);
void scan_smbus(struct device *bus);