diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2008-12-12 23:38:24 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2008-12-12 23:38:24 +0000 |
commit | bfb0fb5dce3cf833ba1520004080a2f8e2b5a970 (patch) | |
tree | 375f4fc2b246774e3ee0ba6ed5cf442e8397e286 /sys/dev/i2c/i2c_scan.c | |
parent | 7cda2a3f97752e58d1effa7a36fe6ba3831f61e3 (diff) |
Check for zero'd spd data even if we pass the checksum
and don't offer a match in this case.
Deals with the qemu "TODO: Populate SPD eeprom data."
tested by todd@
Diffstat (limited to 'sys/dev/i2c/i2c_scan.c')
-rw-r--r-- | sys/dev/i2c/i2c_scan.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/i2c/i2c_scan.c b/sys/dev/i2c/i2c_scan.c index 01cd5885f72..601d20ec510 100644 --- a/sys/dev/i2c/i2c_scan.c +++ b/sys/dev/i2c/i2c_scan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i2c_scan.c,v 1.128 2008/11/13 17:57:15 deraadt Exp $ */ +/* $OpenBSD: i2c_scan.c,v 1.129 2008/12/12 23:38:23 jsg Exp $ */ /* * Copyright (c) 2005 Theo de Raadt <deraadt@openbsd.org> @@ -927,10 +927,12 @@ char * iic_probe_eeprom(struct device *self, u_int8_t addr) { int reg, csum = 0; + u_int8_t size; char *name = NULL; /* SPD EEPROMs should only set lower nibble for size (ie <= 32K) */ - if ((iicprobe(0x01) & 0xf0) != 0) + size = iicprobe(0x01); + if (((size & 0xf0) != 0) || size == 0) return (name); for (reg = 0; reg < 0x3f; reg++) |