From patchwork Sun Sep 3 16:03:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5ZOy?= X-Patchwork-Id: 13373286 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 EC9DFC83F2C for ; Sun, 3 Sep 2023 16:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244630AbjICQUI (ORCPT ); Sun, 3 Sep 2023 12:20:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237525AbjICQUI (ORCPT ); Sun, 3 Sep 2023 12:20:08 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.216]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C7145FE; Sun, 3 Sep 2023 09:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=h9ofA HbdA820d7O9E53lRZ8L9GoG8FbHPVW3A/JR4Bc=; b=He7TosPKInF15QNsb7/u0 SsyFqjcaj52HqYxshubnH3WBiihXHuOrUBe6XcFHnMeL/1w03xhCrIn1V4pQQePY wQZRUz3BxkFOriXyJXE/osDCr3uZ0lZSnzc8gpC3PVpBXKD0W32id/kHyJzMsWsY HByQK39liVylusAAKFO9/g= Received: from localhost.localdomain (unknown [112.22.168.243]) by zwqz-smtp-mta-g3-1 (Coremail) with SMTP id _____wDXHstorvRkiRZSBA--.7483S4; Mon, 04 Sep 2023 00:04:27 +0800 (CST) From: Lizhe To: dmitry.torokhov@gmail.com, geert+renesas@glider.be, Jonathan.Cameron@huawei.com, soyer@irl.hu Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Lizhe Subject: [PATCH] input: gpio-keys - use spin_lock() Date: Sun, 3 Sep 2023 09:03:49 -0700 Message-Id: <20230903160349.3919-1-sensor1010@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: _____wDXHstorvRkiRZSBA--.7483S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrtFy8GF1kZw1rZrW5Wr15Jwb_yoWkWFb_uF yDWr97Cr4Utw15Krn3Gr1fAF9rKF1YvF10kw1Dtay5Kr98Zw4DC397ZrZ3Jr4Dur4xA3Z8 Gr4UW343Cw42kjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRWHq7JUUUUU== X-Originating-IP: [112.22.168.243] X-CM-SenderInfo: 5vhq20jurqiii6rwjhhfrp/xtbBbA7fq1c7QRNYIwAAsT Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Use the spin_lock() and spin_unlock() instead of spin_lock_irqsave() and spin_unlock_restore() Signed-off-by: Lizhe --- drivers/input/keyboard/gpio_keys.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index c928829a8b0c..a55d62e1ff6d 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -468,11 +468,10 @@ static irqreturn_t gpio_keys_irq_isr(int irq, void *dev_id) { struct gpio_button_data *bdata = dev_id; struct input_dev *input = bdata->input; - unsigned long flags; BUG_ON(irq != bdata->irq); - spin_lock_irqsave(&bdata->lock, flags); + spin_lock(&bdata->lock); if (!bdata->key_pressed) { if (bdata->button->wakeup) @@ -495,7 +494,7 @@ static irqreturn_t gpio_keys_irq_isr(int irq, void *dev_id) ms_to_ktime(bdata->release_delay), HRTIMER_MODE_REL_HARD); out: - spin_unlock_irqrestore(&bdata->lock, flags); + spin_unlock(&bdata->lock); return IRQ_HANDLED; }