summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/device/pnp_device.c2
-rw-r--r--src/include/device/pnp.h1
-rw-r--r--src/superio/smsc/smscsuperio/superio.c5
3 files changed, 6 insertions, 2 deletions
diff --git a/src/device/pnp_device.c b/src/device/pnp_device.c
index 28a45d0692..1852fc1b16 100644
--- a/src/device/pnp_device.c
+++ b/src/device/pnp_device.c
@@ -370,7 +370,7 @@ void pnp_enable_devices(struct device *base_dev, struct device_operations *ops,
/* Setup the ops and resources on the newly allocated devices. */
for (i = 0; i < functions; i++) {
/* Skip logical devices this Super I/O doesn't have. */
- if (info[i].function == -1)
+ if (info[i].function == PNP_SKIP_FUNCTION)
continue;
path.pnp.device = info[i].function;
diff --git a/src/include/device/pnp.h b/src/include/device/pnp.h
index 69a0667445..fde4c9d1dd 100644
--- a/src/include/device/pnp.h
+++ b/src/include/device/pnp.h
@@ -34,6 +34,7 @@ extern struct device_operations pnp_ops;
struct pnp_info {
struct device_operations *ops; /* LDN-specific ops override */
+#define PNP_SKIP_FUNCTION 0xffff
unsigned int function; /* Must be at least 16 bits (virtual LDNs)! */
unsigned int flags;
#define PNP_IO0 0x000001
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). */