diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2010-02-19 17:00:57 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2010-02-19 17:00:57 +0000 |
commit | 38dd9cda0ae564bb34f57c2a3963465041bbf372 (patch) | |
tree | 0337630fc1663bbb0207e1d03da22d23442e48bb /sys/dev/usb/if_run.c | |
parent | 8e24365a8f560c62e841daaf93126eb9716d3814 (diff) |
fix run_set_region_4 to set the whole region specified,
not a quarter of it!
Diffstat (limited to 'sys/dev/usb/if_run.c')
-rw-r--r-- | sys/dev/usb/if_run.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index af2e5ea41a4..06360a08396 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.57 2010/02/10 21:46:56 damien Exp $ */ +/* $OpenBSD: if_run.c,v 1.58 2010/02/19 17:00:56 damien Exp $ */ /*- * Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -842,13 +842,12 @@ run_write_region_1(struct run_softc *sc, uint16_t reg, const uint8_t *buf, } int -run_set_region_4(struct run_softc *sc, uint16_t reg, uint32_t val, int len) +run_set_region_4(struct run_softc *sc, uint16_t reg, uint32_t val, int count) { - int i, error = 0; + int error = 0; - KASSERT((len & 3) == 0); - for (i = 0; i < len && error == 0; i += 4) - error = run_write(sc, reg + i, val); + for (; count > 0 && error == 0; count--, reg += 4) + error = run_write(sc, reg, val); return error; } |