summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-07-25 18:54:22 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-07-25 18:54:22 +0000
commite036dfc6a10cd52b51a7ec9234f120bddbfa6dda (patch)
tree5064fbe20a92b9e8a0b57a01453e870ce9e4603e /sys/dev/usb/usb.c
parent9aa55ad5ba036f0a2dfc53a80c7af7b7da3afedb (diff)
downloadFreeBSD-src-e036dfc6a10cd52b51a7ec9234f120bddbfa6dda.zip
FreeBSD-src-e036dfc6a10cd52b51a7ec9234f120bddbfa6dda.tar.gz
Add comments, change variable names to make them consistent (r -> err,
timo_handle -> timeout_handle, p -> pipe, *pipe -> *rpipe, etc.)
Diffstat (limited to 'sys/dev/usb/usb.c')
-rw-r--r--sys/dev/usb/usb.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 9165a4f..c6b825d 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -243,6 +243,7 @@ usbioctl(dev, cmd, data, flag, p)
if (sc == 0 || !sc->sc_running)
return (ENXIO);
+
switch (cmd) {
#ifdef USB_DEBUG
case USB_SETDEBUG:
@@ -345,23 +346,23 @@ usbpoll(dev, events, p)
int events;
struct proc *p;
{
- int revents, s;
+ int revents = 0;
+ int s;
+
USB_GET_SC(usb, USBUNIT(dev), sc);
- DPRINTFN(2, ("usbpoll: sc=%p events=0x%x\n", sc, events));
s = splusb();
- revents = 0;
+
if (events & (POLLOUT | POLLWRNORM))
if (sc->sc_bus->needs_explore)
revents |= events & (POLLOUT | POLLWRNORM);
- DPRINTFN(2, ("usbpoll: revents=0x%x\n", revents));
- if (revents == 0) {
- if (events & (POLLOUT | POLLWRNORM)) {
- DPRINTFN(2, ("usbpoll: selrecord\n"));
+
+ if (revents == 0)
+ if (events & (POLLOUT | POLLWRNORM))
selrecord(p, &sc->sc_consel);
- }
- }
+
splx(s);
+
return (revents);
}
OpenPOWER on IntegriCloud