Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43871 )
Change subject: device/device.h: Add `is_dev_enabled` function ......................................................................
device/device.h: Add `is_dev_enabled` function
There are many places where we do this. Put it inside an inline function for convenience reasons.
Change-Id: I5515a52458b6c78c1a723cb08e6471eb9bac9cd6 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/include/device/device.h 1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/43871/1
diff --git a/src/include/device/device.h b/src/include/device/device.h index 082dcbb..3177854 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -195,6 +195,11 @@ bool dev_is_active_bridge(struct device *dev); void add_more_links(struct device *dev, unsigned int total_links);
+static inline bool is_dev_enabled(const struct device *const dev) +{ + return dev && dev->enabled; +} + /* Option ROM helper functions */ void run_bios(struct device *dev, unsigned long addr);