Skip to content

Commit

Permalink
twsi: trace register accesses only when debug level is at least two
Browse files Browse the repository at this point in the history
Callers already report all interesting values or actions,
so the traces are mostly redundant.
  • Loading branch information
avg-I committed Sep 23, 2021
1 parent 5f2d7e7 commit 4fc6103
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sys/dev/iicbus/twsi/twsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,17 @@ TWSI_READ(struct twsi_softc *sc, bus_size_t off)
uint32_t val;

val = bus_read_4(sc->res[0], off);
debugf(sc->dev, "read %x from %lx\n", val, off);
if (twsi_debug > 1)
debugf(sc->dev, "read %x from %lx\n", val, off);
return (val);
}

static __inline void
TWSI_WRITE(struct twsi_softc *sc, bus_size_t off, uint32_t val)
{

debugf(sc->dev, "Writing %x to %lx\n", val, off);
if (twsi_debug > 1)
debugf(sc->dev, "Writing %x to %lx\n", val, off);
bus_write_4(sc->res[0], off, val);
}

Expand Down

0 comments on commit 4fc6103

Please sign in to comment.