summaryrefslogtreecommitdiff
path: root/sys/dev/i2c/spdmem.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-04-21 05:38:31 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-04-21 05:38:31 +0000
commit6076310bd2bc1f2269c4f46ffda9aaf4d51eaea8 (patch)
tree7663081ada2609363d29ef0cd1dd9c6a87c958b0 /sys/dev/i2c/spdmem.c
parentf742cde3c937cd1c5ccdb6ae9f4b440c94c14d80 (diff)
when iic_exec fails, return 0xff for the read value; ok jsg
Diffstat (limited to 'sys/dev/i2c/spdmem.c')
-rw-r--r--sys/dev/i2c/spdmem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/i2c/spdmem.c b/sys/dev/i2c/spdmem.c
index 3a02f6386e3..dbd24e79692 100644
--- a/sys/dev/i2c/spdmem.c
+++ b/sys/dev/i2c/spdmem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spdmem.c,v 1.24 2008/04/17 19:01:48 deraadt Exp $ */
+/* $OpenBSD: spdmem.c,v 1.25 2008/04/21 05:38:30 deraadt Exp $ */
/* $NetBSD: spdmem.c,v 1.3 2007/09/20 23:09:59 xtraeme Exp $ */
/*
@@ -577,7 +577,7 @@ spdmem_attach(struct device *parent, struct device *self, void *aux)
uint8_t
spdmem_read(struct spdmem_softc *sc, uint8_t reg)
{
- uint8_t val;
+ uint8_t val = 0xff;
iic_acquire_bus(sc->sc_tag,0);
iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr,