diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2012-11-11 19:38:02 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-16 03:34:18 +0400 |
commit | 744f0f2f424d374b233cea5f9b34caa851543755 (patch) | |
tree | 44a752a23b215fdbe390646aa5ab2f25025eb8ee /drivers/misc/mei/amthif.c | |
parent | a562d5c25aa48c23774ab8d60bfd3bbcbca4bf1d (diff) | |
download | linux-744f0f2f424d374b233cea5f9b34caa851543755.tar.xz |
mei: extract amthif specific code from mei_poll to mei_amthif_poll
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/amthif.c')
-rw-r--r-- | drivers/misc/mei/amthif.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c index 8f4373aa9e24..7416241dce88 100644 --- a/drivers/misc/mei/amthif.c +++ b/drivers/misc/mei/amthif.c @@ -401,6 +401,25 @@ void mei_amthif_run_next_cmd(struct mei_device *dev) } } + +unsigned int mei_amthif_poll(struct mei_device *dev, + struct file *file, poll_table *wait) +{ + unsigned int mask = 0; + mutex_unlock(&dev->device_lock); + poll_wait(file, &dev->iamthif_cl.wait, wait); + mutex_lock(&dev->device_lock); + if (dev->iamthif_state == MEI_IAMTHIF_READ_COMPLETE && + dev->iamthif_file_object == file) { + mask |= (POLLIN | POLLRDNORM); + dev_dbg(&dev->pdev->dev, "run next amthi cb\n"); + mei_amthif_run_next_cmd(dev); + } + return mask; +} + + + /** * mei_amthif_irq_process_completed - processes completed iamthif operation. * |