diff options
author | 2019-11-30 18:14:47 +0000 | |
---|---|---|
committer | 2019-11-30 18:14:47 +0000 | |
commit | 8d8b9c74e1a2d714eb51961bab8f47384d429b20 (patch) | |
tree | 9cc563297a67ed31cf24cadf26131abd4437d10d | |
parent | utwitch(4): tsleep(9) -> tsleep_nsec(9); ok jca@ (diff) | |
download | wireguard-openbsd-8d8b9c74e1a2d714eb51961bab8f47384d429b20.tar.xz wireguard-openbsd-8d8b9c74e1a2d714eb51961bab8f47384d429b20.zip |
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; |