summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2018-07-06 19:38:24 +0200
committerMartin Roth <martinroth@google.com>2018-07-17 18:06:19 +0000
commit745e58a5ee50373276924349524a2594599e8bb5 (patch)
treed94136e670d162e703c8ee720924ef1462ad3e20 /src
parentf17a0df112ec3351a9ea344408a39dc895bf1788 (diff)
downloadcoreboot-745e58a5ee50373276924349524a2594599e8bb5.tar.xz
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 <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/27384 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src')
-rw-r--r--src/device/pnp_device.c9
-rw-r--r--src/include/device/pnp.h2
2 files changed, 7 insertions, 4 deletions
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]);
}
diff --git a/src/include/device/pnp.h b/src/include/device/pnp.h
index e3839c6e71..d7530131d9 100644
--- a/src/include/device/pnp.h
+++ b/src/include/device/pnp.h
@@ -31,7 +31,7 @@ extern struct device_operations pnp_ops;
/* PNP helper operations */
struct pnp_info {
- struct device_operations *ops;
+ struct device_operations *ops; /* LDN-specific ops override */
unsigned int function; /* Must be at least 16 bits (virtual LDNs)! */
unsigned int flags;
#define PNP_IO0 0x000001