From patchwork Tue May 23 15:13:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 685522 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1114CC77B75 for ; Tue, 23 May 2023 15:15:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233373AbjEWPOq (ORCPT ); Tue, 23 May 2023 11:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237478AbjEWPOT (ORCPT ); Tue, 23 May 2023 11:14:19 -0400 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9151D188 for ; Tue, 23 May 2023 08:13:59 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:b0ac:7afd:272:4cff]) by andre.telenet-ops.be with bizsmtp id 0FDx2A0020Jkz7G01FDxrP; Tue, 23 May 2023 17:13:57 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1q1Thm-002swf-JF; Tue, 23 May 2023 17:13:57 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1q1Ti1-00CkQr-0X; Tue, 23 May 2023 17:13:57 +0200 From: Geert Uytterhoeven To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] [resend] Input: gpio-keys - Use input_report_key() Date: Tue, 23 May 2023 17:13:55 +0200 Message-Id: <185f3320e39000159d4bd843fd3119b94c30d607.1684854795.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Use the input_report_key() helper instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven --- drivers/input/keyboard/gpio_keys.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 5e18ef01b0340f1b..7e8342ef7a79b17f 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -456,7 +456,7 @@ static enum hrtimer_restart gpio_keys_irq_timer(struct hrtimer *t) struct input_dev *input = bdata->input; if (bdata->key_pressed) { - input_event(input, EV_KEY, *bdata->code, 0); + input_report_key(input, *bdata->code, 0); input_sync(input); bdata->key_pressed = false; } @@ -478,11 +478,11 @@ static irqreturn_t gpio_keys_irq_isr(int irq, void *dev_id) if (bdata->button->wakeup) pm_wakeup_event(bdata->input->dev.parent, 0); - input_event(input, EV_KEY, *bdata->code, 1); + input_report_key(input, *bdata->code, 1); input_sync(input); if (!bdata->release_delay) { - input_event(input, EV_KEY, *bdata->code, 0); + input_report_key(input, *bdata->code, 0); input_sync(input); goto out; }