提交 11bb4cc7 编写于 作者: S Samu Onkalo 提交者: Dmitry Torokhov

Input: polled device - do not start polling if interval is zero

If the poll interval is set to 0 via new sysfs entry and device is
opened after that, polling is started with interval 0. This causes
huge CPU load. Same happens if the rate was 0 when the device was
closed and then reopened.
Signed-off-by: NSamu Onkalo <samu.p.onkalo@nokia.com>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 381f3f1c
...@@ -88,7 +88,9 @@ static int input_open_polled_device(struct input_dev *input) ...@@ -88,7 +88,9 @@ static int input_open_polled_device(struct input_dev *input)
if (dev->open) if (dev->open)
dev->open(dev); dev->open(dev);
queue_delayed_work(polldev_wq, &dev->work, 0); /* Only start polling if polling is enabled */
if (dev->poll_interval > 0)
queue_delayed_work(polldev_wq, &dev->work, 0);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册