diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-06-21 15:58:20 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-06-21 15:58:20 +0000 |
commit | 7e13fccd703da0bc68c2560a3c6687efdafc9273 (patch) | |
tree | 94581afbc5e2e2aad1bb384ba9df87de2521858d /sys/dev/ic/pcf8584.c | |
parent | a36775fd424dd76ba3c972be95b6a454fb7e9d0b (diff) |
properly handle timeout failure in while loop
Diffstat (limited to 'sys/dev/ic/pcf8584.c')
-rw-r--r-- | sys/dev/ic/pcf8584.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ic/pcf8584.c b/sys/dev/ic/pcf8584.c index 8ad1b91f2f3..7c99ebfe154 100644 --- a/sys/dev/ic/pcf8584.c +++ b/sys/dev/ic/pcf8584.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcf8584.c,v 1.5 2006/06/15 16:25:22 deraadt Exp $ */ +/* $OpenBSD: pcf8584.c,v 1.6 2006/06/21 15:58:19 deraadt Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -211,7 +211,7 @@ pcfiic_xmit(struct pcfiic_softc *sc, u_int8_t addr, const u_int8_t *buf, while ((r = pcfiic_read(sc, PCF_S1)) & PCF_STAT_PIN) { if (--tries == 0) { err = 1; - break; + goto fail; } DELAY(1); } @@ -224,7 +224,7 @@ pcfiic_xmit(struct pcfiic_softc *sc, u_int8_t addr, const u_int8_t *buf, if (i < len) pcfiic_write(sc, PCF_S0, buf[i]); } - +fail: pcfiic_write(sc, PCF_S1, PCF_CTRL_STOP); return (err); } |