Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36415
b: refs/heads/master
c: e22fc27
h: refs/heads/master
i:
  36413: b3e9b22
  36411: 3ddc733
  36407: 7b3143d
  36399: 6809700
  36383: d457c67
  36351: eff43d1
v: v3
  • Loading branch information
Milan Svoboda authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent 39c99f5 commit 5ab9b0c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9bcbcf4d00cd2400e655a738e77f0d21b69c6771
refs/heads/master: e22fc27c87b41bda1b0daf8436224b0f79853482
32 changes: 31 additions & 1 deletion trunk/drivers/usb/gadget/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/compiler.h>
#include <asm/uaccess.h>
#include <linux/slab.h>
#include <linux/poll.h>

#include <linux/device.h>
#include <linux/moduleparam.h>
Expand Down Expand Up @@ -1235,6 +1236,35 @@ dev_release (struct inode *inode, struct file *fd)
return 0;
}

static unsigned int
ep0_poll (struct file *fd, poll_table *wait)
{
struct dev_data *dev = fd->private_data;
int mask = 0;

poll_wait(fd, &dev->wait, wait);

spin_lock_irq (&dev->lock);

/* report fd mode change before acting on it */
if (dev->setup_abort) {
dev->setup_abort = 0;
mask = POLLHUP;
goto out;
}

if (dev->state == STATE_SETUP) {
if (dev->setup_in || dev->setup_can_stall)
mask = POLLOUT;
} else {
if (dev->ev_next != 0)
mask = POLLIN;
}
out:
spin_unlock_irq(&dev->lock);
return mask;
}

static int dev_ioctl (struct inode *inode, struct file *fd,
unsigned code, unsigned long value)
{
Expand All @@ -1254,7 +1284,7 @@ static const struct file_operations ep0_io_operations = {
.read = ep0_read,
.write = ep0_write,
.fasync = ep0_fasync,
// .poll = ep0_poll,
.poll = ep0_poll,
.ioctl = dev_ioctl,
.release = dev_release,
};
Expand Down

0 comments on commit 5ab9b0c

Please sign in to comment.