From patchwork Sat Mar 2 17:53:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Li X-Patchwork-Id: 10836707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43B7F17E0 for ; Sat, 2 Mar 2019 17:54:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EF4F286C6 for ; Sat, 2 Mar 2019 17:54:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22E7F2A9A9; Sat, 2 Mar 2019 17:54:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C118C286C6 for ; Sat, 2 Mar 2019 17:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726295AbfCBRyK (ORCPT ); Sat, 2 Mar 2019 12:54:10 -0500 Received: from tomli.me ([153.92.126.73]:41934 "EHLO tomli.me" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbfCBRyJ (ORCPT ); Sat, 2 Mar 2019 12:54:09 -0500 Received: from tomli.me (localhost [127.0.0.1]) by tomli.me (OpenSMTPD) with ESMTP id a1b095aa; Sat, 2 Mar 2019 17:54:06 +0000 (UTC) X-HELO: localhost.lan Authentication-Results: tomli.me; auth=pass (login) smtp.auth=tomli Received: from Unknown (HELO localhost.lan) (2402:f000:1:1501:200:5efe:3d30:3659) by tomli.me (qpsmtpd/0.95) with ESMTPSA (DHE-RSA-CHACHA20-POLY1305 encrypted); Sat, 02 Mar 2019 17:54:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tomli.me; h=from:to:cc:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=1490979754; bh=vD8wIHxTaA+QFi1c9PDntjTUfB+mxBi+vzJRThgV/9Y=; b=rbwmQQ7TIVKg5CkoAZ2tiCPZ/LpfuAwIt2TQpeam6a4oohfJUqVmAMMqixF3PlgWw6T0ZJqoTChF0yJ2QQUsVuINJtvXxRcwg6xJ2bTlMhJItMWnIEWninrn2qZdg3eYJdTRzWy31pc55GDj0qRUsol7xORUJ1wu96eFzAdNZ2vdGNpW3yS2+gafYRMQgk0lcFuZ7KbwwIw/kQoUE5f+RcS3VTnkOVw5Wxi+eMmtMR6z7w+PS4GENs1K7qXZwGudNY/o4i3KWidxumwLg/bMeU3fEXSTx+4feY/LJj4L73IA2nfPj9QCOTVqqC1xdEkYpJTWL3JPXDf2XUCMU4v1mA== From: Yifeng Li To: Lee Jones , linux-mips@vger.kernel.org Cc: Yifeng Li , Jiaxun Yang , Huacai Chen , Ralf Baechle , Paul Burton , James Hogan , linux-kernel@vger.kernel.org Subject: [PATCH 4/7] mips: loongson64: remove yeeloong_report_lid_status from pm.c Date: Sun, 3 Mar 2019 01:53:31 +0800 Message-Id: <20190302175334.5103-5-tomli@tomli.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190302175334.5103-1-tomli@tomli.me> References: <20190302175334.5103-1-tomli@tomli.me> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is some complicated logic in lemote-2f/pm.c. During wakeup, it creates a delayed_work to execute a callback to the function yeeloong_report_lid_status(). It's only purpose is to report the current status of the laptop lid switch, and this callback function wan not implemented in the mainline kernel. This level of overenginnering hardly makes sense. All we need is to report the laptop lid switch unconditionally upon wakeup in the future PM code, which is being worked on. Signed-off-by: Yifeng Li --- arch/mips/loongson64/lemote-2f/pm.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/arch/mips/loongson64/lemote-2f/pm.c b/arch/mips/loongson64/lemote-2f/pm.c index 4ee7e9864700..ebe4b57535f0 100644 --- a/arch/mips/loongson64/lemote-2f/pm.c +++ b/arch/mips/loongson64/lemote-2f/pm.c @@ -80,17 +80,6 @@ void setup_wakeup_events(void) } } -static struct delayed_work lid_task; -static int initialized; -/* yeeloong_report_lid_status will be implemented in yeeloong_laptop.c */ -sci_handler yeeloong_report_lid_status; -EXPORT_SYMBOL(yeeloong_report_lid_status); -static void yeeloong_lid_update_task(struct work_struct *work) -{ - if (yeeloong_report_lid_status) - yeeloong_report_lid_status(KB3310B_BIT_LID_DETECT_ON); -} - int wakeup_loongson(void) { int irq; @@ -119,17 +108,6 @@ int wakeup_loongson(void) lid_status = kb3310b_read(KB3310B_REG_LID_DETECT); /* wakeup cpu when people open the LID */ if (lid_status == KB3310B_BIT_LID_DETECT_ON) { - /* If we call it directly here, the WARNING - * will be sent out by getnstimeofday - * via "WARN_ON(timekeeping_suspended);" - * because we can not schedule in suspend mode. - */ - if (initialized == 0) { - INIT_DELAYED_WORK(&lid_task, - yeeloong_lid_update_task); - initialized = 1; - } - schedule_delayed_work(&lid_task, 1); return 1; } }