All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Shiyan <shc_work@mail.ru>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Alexander Shiyan <shc_work@mail.ru>
Subject: [PATCH] input: clps711x-keypad: Remove cond_resched() call
Date: Fri, 19 Sep 2014 12:29:06 +0400	[thread overview]
Message-ID: <1411115346-22034-1-git-send-email-shc_work@mail.ru> (raw)

cond_resched() is not works as expected for clps711x-keypad driver
and cause runtime error.
This patch replaces this call with udelay().

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/input/keyboard/clps711x-keypad.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/clps711x-keypad.c b/drivers/input/keyboard/clps711x-keypad.c
index 552b65c..650205d 100644
--- a/drivers/input/keyboard/clps711x-keypad.c
+++ b/drivers/input/keyboard/clps711x-keypad.c
@@ -9,13 +9,13 @@
  * (at your option) any later version.
  */
 
+#include <linux/delay.h>
 #include <linux/input.h>
 #include <linux/input-polldev.h>
 #include <linux/module.h>
 #include <linux/of_gpio.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
-#include <linux/sched.h>
 #include <linux/input/matrix_keypad.h>
 #include <linux/mfd/syscon.h>
 #include <linux/mfd/syscon/clps711x.h>
@@ -54,9 +54,9 @@ static void clps711x_keypad_poll(struct input_polled_dev *dev)
 
 			/* Read twice for protection against fluctuations */
 			do {
-				state = gpiod_get_value_cansleep(data->desc);
-				cond_resched();
-				state1 = gpiod_get_value_cansleep(data->desc);
+				state = gpiod_get_value(data->desc);
+				udelay(5);
+				state1 = gpiod_get_value(data->desc);
 			} while (state != state1);
 
 			if (test_bit(col, data->last_state) != state) {
-- 
1.8.5.5


             reply	other threads:[~2014-09-19  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19  8:29 Alexander Shiyan [this message]
2014-10-07 23:48 ` [PATCH] input: clps711x-keypad: Remove cond_resched() call Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1411115346-22034-1-git-send-email-shc_work@mail.ru \
    --to=shc_work@mail.ru \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.