Fix a cloned error in driver poll setup

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4132 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-12-03 16:13:40 +00:00
parent f1b07efc09
commit bc29aea397
4 changed files with 29 additions and 6 deletions
+4 -2
View File
@@ -1073,7 +1073,7 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds,
{
FAR struct inode *inode;
FAR struct tsc2007_dev_s *priv;
int ret = OK;
int ret;
int i;
ivdbg("setup: %d\n", (int)setup);
@@ -1098,8 +1098,9 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds,
{
/* Ignore waits that do not include POLLIN */
if ((fds->revents & POLLIN) == 0)
if ((fds->events & POLLIN) == 0)
{
idbg("Missing POLLIN: revents: %08x\n", fds->revents);
ret = -EDEADLK;
goto errout;
}
@@ -1124,6 +1125,7 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds,
if (i >= CONFIG_TSC2007_NPOLLWAITERS)
{
idbg("No availabled slot found: %d\n", i);
fds->priv = NULL;
ret = -EBUSY;
goto errout;