mirror of
https://github.com/openbsd/src.git
synced 2026-06-18 23:33:33 +02:00
ihidev(4): tsleep(9) -> tsleep_nsec(9); ok mpi@ jcs@
This commit is contained in:
+3
-10
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ihidev.c,v 1.21 2019/07/31 16:09:12 jcs Exp $ */
|
||||
/* $OpenBSD: ihidev.c,v 1.22 2020/01/24 04:03:11 cheloha Exp $ */
|
||||
/*
|
||||
* HID-over-i2c driver
|
||||
*
|
||||
@@ -74,8 +74,6 @@ int ihidev_maxrepid(void *buf, int len);
|
||||
int ihidev_print(void *aux, const char *pnp);
|
||||
int ihidev_submatch(struct device *parent, void *cf, void *aux);
|
||||
|
||||
extern int hz;
|
||||
|
||||
struct cfattach ihidev_ca = {
|
||||
sizeof(struct ihidev_softc),
|
||||
ihidev_match,
|
||||
@@ -264,15 +262,10 @@ ihidev_activate(struct device *self, int act)
|
||||
void
|
||||
ihidev_sleep(struct ihidev_softc *sc, int ms)
|
||||
{
|
||||
int to = ms * hz / 1000;
|
||||
|
||||
if (cold)
|
||||
delay(ms * 1000);
|
||||
else {
|
||||
if (to <= 0)
|
||||
to = 1;
|
||||
tsleep(&sc, PWAIT, "ihidev", to);
|
||||
}
|
||||
else
|
||||
tsleep_nsec(&sc, PWAIT, "ihidev", MSEC_TO_NSEC(ms));
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user