From 745e58a5ee50373276924349524a2594599e8bb5 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Fri, 6 Jul 2018 19:38:24 +0200 Subject: pnp_device: improve readability Add comments on the ops handling in pnp_enable_devices function and the pnp_info struct. Also remove the negation in the check if an LDN-specific override is used. This patch doesn't change the logic though. Change-Id: I3e80dbce1f29ee3e95e3b1d71c9b8479561d5c1a Signed-off-by: Felix Held Reviewed-on: https://review.coreboot.org/27384 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Patrick Rudolph --- src/device/pnp_device.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/device/pnp_device.c') diff --git a/src/device/pnp_device.c b/src/device/pnp_device.c index ba05c82d5e..5600231207 100644 --- a/src/device/pnp_device.c +++ b/src/device/pnp_device.c @@ -386,10 +386,13 @@ void pnp_enable_devices(struct device *base_dev, struct device_operations *ops, if (dev->ops) continue; - if (info[i].ops == 0) - dev->ops = ops; - else + /* use LDN-specific ops override from corresponding pnp_info + entry if not NULL */ + if (info[i].ops) dev->ops = info[i].ops; + /* else use device ops */ + else + dev->ops = ops; get_resources(dev, &info[i]); } -- cgit v1.2.3