Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/80598?usp=email )
Change subject: device/pnp_device: Skip init on disabled functions ......................................................................
device/pnp_device: Skip init on disabled functions
If a function defined in a device's pnp_info struct is explcitly disabled in a board devicetree, we should not get/set/assign any resources to that function.
TEST=build/boot purism/librem_cnl (Mini v2), inspect cbmem log and verify PNP functions disabled in devicetree don't show up in the log / don't cause any errors.
Change-Id: I5c9d5cf34947535bf249b91f78d6fabfb28729ea Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/device/pnp_device.c 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/98/80598/1
diff --git a/src/device/pnp_device.c b/src/device/pnp_device.c index f799530..a968d39 100644 --- a/src/device/pnp_device.c +++ b/src/device/pnp_device.c @@ -386,6 +386,10 @@ path.pnp.device = info[i].function; dev = alloc_find_dev(base_dev->upstream, &path);
+ /* Don't initialize a disabled device. */ + if (!dev->enabled) + continue; + /* Don't initialize a device multiple times. */ if (dev->ops) continue;