diff options
| author | Maxim Sobolev <sobomax@FreeBSD.org> | 2003-04-30 22:15:47 +0000 |
|---|---|---|
| committer | Maxim Sobolev <sobomax@FreeBSD.org> | 2003-04-30 22:15:47 +0000 |
| commit | e9442e03ca0af78bb37791699b53cfae55b8d08e (patch) | |
| tree | cbc9889974aef9fd663a4483399ec2a449b463de /sys/dev/puc/puc.c | |
| parent | 5dacb0cdba9b86b7dd1b42d68e9aca35bcbea41c (diff) | |
Notes
Diffstat (limited to 'sys/dev/puc/puc.c')
| -rw-r--r-- | sys/dev/puc/puc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c index fedf9bb073cf..5cfe3ab74a70 100644 --- a/sys/dev/puc/puc.c +++ b/sys/dev/puc/puc.c @@ -140,7 +140,7 @@ puc_probe_ilr(struct puc_softc *sc, struct resource *res) case PUC_ILR_TYPE_DIGI: sc->ilr_st = rman_get_bustag(res); sc->ilr_sh = rman_get_bushandle(res); - for (i = 0; i < 2; i++) { + for (i = 0; i < 2 && sc->sc_desc->ilr_offset[i] != 0; i++) { t1 = bus_space_read_1(sc->ilr_st, sc->ilr_sh, sc->sc_desc->ilr_offset[i]); t1 = ~t1; @@ -353,7 +353,7 @@ puc_ilr_read(struct puc_softc *sc) mask = 0; switch (sc->sc_desc->ilr_type) { case PUC_ILR_TYPE_DIGI: - for (i = 1; i >= 0; i--) { + for (i = 1; i >= 0 && sc->sc_desc->ilr_offset[i] != 0; i--) { mask = (mask << 8) | (bus_space_read_1(sc->ilr_st, sc->ilr_sh, sc->sc_desc->ilr_offset[i]) & 0xff); } |
