diff options
author | cheloha <cheloha@cvs.openbsd.org> | 2019-11-30 18:14:48 +0000 |
---|---|---|
committer | cheloha <cheloha@cvs.openbsd.org> | 2019-11-30 18:14:48 +0000 |
commit | 7fe0a3edede65590be6d4f6e79e247cd5ce6b30d (patch) | |
tree | b673b31fee990790346d40f5ebfc229f44c045a4 | |
parent | edbde5a085d87c1f18ccf8d5df15867426f1711d (diff) |
onewire(4), owtemp(4): tsleep(9) -> tsleep_nsec(9); ok jca@
-rw-r--r-- | sys/dev/onewire/onewire.c | 10 | ||||
-rw-r--r-- | sys/dev/onewire/owtemp.c | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/onewire/onewire.c b/sys/dev/onewire/onewire.c index 679bcd90e85..16c6796e16d 100644 --- a/sys/dev/onewire/onewire.c +++ b/sys/dev/onewire/onewire.c @@ -1,4 +1,4 @@ -/* $OpenBSD: onewire.c,v 1.17 2017/04/03 16:10:00 deraadt Exp $ */ +/* $OpenBSD: onewire.c,v 1.18 2019/11/30 18:14:47 cheloha Exp $ */ /* * Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org> @@ -39,7 +39,7 @@ #endif #define ONEWIRE_MAXDEVS 16 -#define ONEWIRE_SCANTIME 3 +#define ONEWIRE_SCANTIME SEC_TO_NSEC(3) struct onewire_softc { struct device sc_dev; @@ -121,7 +121,7 @@ onewire_detach(struct device *self, int flags) sc->sc_dying = 1; if (sc->sc_thread != NULL) { wakeup(sc->sc_thread); - tsleep(&sc->sc_dying, PWAIT, "owdt", 0); + tsleep_nsec(&sc->sc_dying, PWAIT, "owdt", INFSLP); } return (config_detach_children(self, flags)); @@ -326,7 +326,7 @@ onewire_search(void *arg, u_int64_t *buf, int size, u_int64_t startrom) while (search && count < size) { /* XXX: yield processor */ - tsleep(sc, PWAIT, "owscan", hz / 10); + tsleep_nsec(sc, PWAIT, "owscan", MSEC_TO_NSEC(100)); /* * Start new search. Go through the previous path to @@ -400,7 +400,7 @@ onewire_thread(void *arg) onewire_scan(sc); if (sc->sc_flags & ONEWIRE_NO_PERIODIC_SCAN) break; - tsleep(sc->sc_thread, PWAIT, "owidle", ONEWIRE_SCANTIME * hz); + tsleep_nsec(sc->sc_thread, PWAIT, "owidle", ONEWIRE_SCANTIME); } sc->sc_thread = NULL; diff --git a/sys/dev/onewire/owtemp.c b/sys/dev/onewire/owtemp.c index e883dbb17a9..886adc590b4 100644 --- a/sys/dev/onewire/owtemp.c +++ b/sys/dev/onewire/owtemp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: owtemp.c,v 1.16 2014/09/14 14:17:25 jsg Exp $ */ +/* $OpenBSD: owtemp.c,v 1.17 2019/11/30 18:14:47 cheloha Exp $ */ /* * Copyright (c) 2006, 2009 Alexander Yurchenko <grange@openbsd.org> @@ -158,7 +158,7 @@ owtemp_update(void *arg) * at least this period. */ onewire_write_byte(sc->sc_onewire, DS1920_CMD_CONVERT); - tsleep(sc, PRIBIO, "owtemp", hz); + tsleep_nsec(sc, PRIBIO, "owtemp", SEC_TO_NSEC(1)); if (onewire_reset(sc->sc_onewire) != 0) goto done; |