From patchwork Fri Sep 19 08:29:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 4936621 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5E414BEEA5 for ; Fri, 19 Sep 2014 08:44:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21A4E20121 for ; Fri, 19 Sep 2014 08:44:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5BD94200FE for ; Fri, 19 Sep 2014 08:44:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753250AbaISIoS (ORCPT ); Fri, 19 Sep 2014 04:44:18 -0400 Received: from fallback4.mail.ru ([94.100.181.169]:43031 "EHLO fallback4.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754082AbaISIoQ (ORCPT ); Fri, 19 Sep 2014 04:44:16 -0400 X-Greylist: delayed 884 seconds by postgrey-1.27 at vger.kernel.org; Fri, 19 Sep 2014 04:44:16 EDT Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) by fallback4.mail.ru (mPOP.Fallback_MX) with ESMTP id 31DE033150B for ; Fri, 19 Sep 2014 12:29:31 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Message-Id:Date:Subject:Cc:To:From; bh=StNz6oDccbOv7gmcWW3WO1pGH9yiZlKwnqtBxsgay2s=; b=shljsCxo7VyjCjTkl5CkZ+IDH49FVjOM6Qy6Wb99y8urYyqyJdrHqHIdvkdWhIQKAkB5sXNp7QPYt3Rvh8Z2EwB4kmG8MwvyvHBabme9kJ8EJfUXF03jkwUUC4uqHEWFkB8UAE1hUuo0ENCms+1fSUF+GLdOtbNjAkduAnajk2Y=; Received: from [217.119.30.118] (port=54849 helo=shc.milas.spb.ru) by smtp53.i.mail.ru with esmtpa (envelope-from ) id 1XUtZ8-00008w-Dn; Fri, 19 Sep 2014 12:29:19 +0400 From: Alexander Shiyan To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Alexander Shiyan Subject: [PATCH] input: clps711x-keypad: Remove cond_resched() call Date: Fri, 19 Sep 2014 12:29:06 +0400 Message-Id: <1411115346-22034-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.5.5 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_WEB,RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Mras: Ok Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB, RDNS_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 #include #include #include #include #include #include -#include #include #include #include @@ -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) {