diff --git a/src/device/device_const.c b/src/device/device_const.c index 20afe7e445..7e7f2f1980 100644 --- a/src/device/device_const.c +++ b/src/device/device_const.c @@ -397,3 +397,9 @@ bool is_dev_enabled(const struct device *dev) return false; return dev->enabled; } + +bool is_devfn_enabled(unsigned int devfn) +{ + const struct device *dev = pcidev_path_on_root(devfn); + return is_dev_enabled(dev); +} diff --git a/src/include/device/device.h b/src/include/device/device.h index 623d337601..afa6a4090a 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -192,6 +192,7 @@ 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); bool is_dev_enabled(const struct device *const dev); +bool is_devfn_enabled(unsigned int devfn); /* Option ROM helper functions */ void run_bios(struct device *dev, unsigned long addr);