aboutsummaryrefslogtreecommitdiff
path: root/src/superio
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2019-12-15 13:53:48 +0100
committerFelix Held <felix-coreboot@felixheld.de>2019-12-16 13:40:05 +0000
commit7b7bc59f2016264d02fa245341e3507539dcac8f (patch)
tree3467e3891200b2d652901159c84fe22e7aaae303 /src/superio
parent116a837818897d5f1f0c76021d48532133e8f5f6 (diff)
device/pnp: introduce and use PNP_SKIP_FUNCTION
-1 shouldn't be assigned to an unsigned variable, so use an otherwise unused constant here. Since 7 is the highest virtual LDN number, using 0xffff as PNP_SKIP_FUNCTION marker has no unwanted side effects. Change-Id: I5e31e7ef9dad5fedfd5552963c298336c533a5e9 Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37741 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/superio')
-rw-r--r--src/superio/smsc/smscsuperio/superio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/superio/smsc/smscsuperio/superio.c b/src/superio/smsc/smscsuperio/superio.c
index aa5af38250..0e86683da3 100644
--- a/src/superio/smsc/smscsuperio/superio.c
+++ b/src/superio/smsc/smscsuperio/superio.c
@@ -280,7 +280,10 @@ static void enable_dev(struct device *dev)
*/
for (j = 0; j < ARRAY_SIZE(pnp_dev_info); j++) {
fn = pnp_dev_info[j].function;
- pnp_dev_info[j].function = logical_device_table[i].devs[fn];
+ if (logical_device_table[i].devs[fn] != -1)
+ pnp_dev_info[j].function = logical_device_table[i].devs[fn];
+ else
+ pnp_dev_info[j].function = PNP_SKIP_FUNCTION;
}
/* Enable the specified devices (if present on the chip). */