diff options
author | Angel Pons <th3fanbus@gmail.com> | 2020-07-25 16:00:28 +0200 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2020-07-26 20:44:36 +0000 |
commit | a7d92668326adbe61d29b476cd4676decca131eb (patch) | |
tree | 4c59e9561d4f3a109cce609ad97ff8070e603968 /src/include | |
parent | 7cf1f203e951eee8d35fc0280f0fb022d609ad74 (diff) |
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>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43871
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Michael Niewöhner
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/device/device.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h index 082dcbb4d3..317785429d 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -195,6 +195,11 @@ void disable_children(struct bus *bus); 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); |