summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-03-05 19:20:17 +0000
committerthompsa <thompsa@FreeBSD.org>2009-03-05 19:20:17 +0000
commit217c09dffc7d5e0d80e98fe648855f9e3c1eee22 (patch)
treeaaa1685b00ec78073e5713537af500b4ad7698f5 /sys/dev/usb
parent782a5accb69ded4cb79bddb64c136dc18d548122 (diff)
downloadFreeBSD-src-217c09dffc7d5e0d80e98fe648855f9e3c1eee22.zip
FreeBSD-src-217c09dffc7d5e0d80e98fe648855f9e3c1eee22.tar.gz
Fix usb2_poll not to return an error number as the function return value is a
bitmask of events. Pointed out by: HPS
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/usb_dev.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c
index d206340..512b1f8 100644
--- a/sys/dev/usb/usb_dev.c
+++ b/sys/dev/usb/usb_dev.c
@@ -1072,16 +1072,12 @@ usb2_poll(struct cdev* dev, int events, struct thread* td)
struct usb2_cdev_privdata* cpd;
struct usb2_fifo *f;
struct usb2_mbuf *m;
- int fflags;
- int err, revents;
-
- err = devfs_get_cdevpriv((void **)&cpd);
- if (err != 0)
- return (err);
+ int fflags, revents;
- err = usb2_ref_device(cpd, 0 /* no uref */ );
- if (err)
- return (POLLHUP);
+ if (devfs_get_cdevpriv((void **)&cpd) != 0 ||
+ usb2_ref_device(cpd, 0) != 0)
+ return (events &
+ (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM));
fflags = cpd->fflags;
OpenPOWER on IntegriCloud