From patchwork Tue Apr 14 02:44:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrique de Moraes Holschuh X-Patchwork-Id: 18006 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3E2iNUU014179 for ; Tue, 14 Apr 2009 02:44:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752014AbZDNCoX (ORCPT ); Mon, 13 Apr 2009 22:44:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751463AbZDNCoX (ORCPT ); Mon, 13 Apr 2009 22:44:23 -0400 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:37118 "EHLO out2.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbZDNCoV (ORCPT ); Mon, 13 Apr 2009 22:44:21 -0400 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 0F036319E01; Mon, 13 Apr 2009 22:44:19 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 13 Apr 2009 22:44:19 -0400 X-Sasl-enc: FKF1YLxL7BX2va2gjLzQI+weJHqu84QndoS3wSmGYGp2 1239677058 Received: from khazad-dum.debian.net (unknown [201.82.166.239]) by mail.messagingengine.com (Postfix) with ESMTPSA id 936DD48CC1; Mon, 13 Apr 2009 22:44:18 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by localhost.khazad-dum.debian.net (Postfix) with ESMTP id 5D84210008; Mon, 13 Apr 2009 23:44:16 -0300 (BRT) X-Virus-Scanned: Debian amavisd-new at khazad-dum.debian.net Received: from khazad-dum.debian.net ([127.0.0.1]) by localhost (khazad-dum.debian.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 0M8hjvuDd3WV; Mon, 13 Apr 2009 23:44:14 -0300 (BRT) Received: by khazad-dum.debian.net (Postfix, from userid 1000) id 3CB4F10003; Mon, 13 Apr 2009 23:44:14 -0300 (BRT) From: Henrique de Moraes Holschuh To: Len Brown Cc: linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, Henrique de Moraes Holschuh Subject: [PATCH 1/5] thinkpad-acpi: silence hotkey enable warning for module parameter Date: Mon, 13 Apr 2009 23:44:10 -0300 Message-Id: <1239677054-3221-2-git-send-email-hmh@hmh.eng.br> X-Mailer: git-send-email 1.6.2.1 In-Reply-To: <1239677054-3221-1-git-send-email-hmh@hmh.eng.br> References: <1239677054-3221-1-git-send-email-hmh@hmh.eng.br> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Avoid the WARN() when the procfs handler for hotkey enable is used by a module parameter. Instead, urge the user to stop doing that. Reported-by: Niel Lambrechts Signed-off-by: Henrique de Moraes Holschuh --- drivers/platform/x86/thinkpad_acpi.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index a40b075..a186c5b 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -2946,12 +2946,18 @@ static int hotkey_read(char *p) return len; } -static void hotkey_enabledisable_warn(void) +static void hotkey_enabledisable_warn(bool enable) { tpacpi_log_usertask("procfs hotkey enable/disable"); - WARN(1, TPACPI_WARN - "hotkey enable/disable functionality has been " - "removed from the driver. Hotkeys are always enabled.\n"); + if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable), + TPACPI_WARN + "hotkey enable/disable functionality has been " + "removed from the driver. Hotkeys are always " + "enabled\n")) + printk(TPACPI_ERR + "Please remove the hotkey=enable module " + "parameter, it is deprecated. Hotkeys are always " + "enabled\n"); } static int hotkey_write(char *buf) @@ -2971,9 +2977,9 @@ static int hotkey_write(char *buf) res = 0; while ((cmd = next_cmd(&buf))) { if (strlencmp(cmd, "enable") == 0) { - hotkey_enabledisable_warn(); + hotkey_enabledisable_warn(1); } else if (strlencmp(cmd, "disable") == 0) { - hotkey_enabledisable_warn(); + hotkey_enabledisable_warn(0); res = -EPERM; } else if (strlencmp(cmd, "reset") == 0) { mask = hotkey_orig_mask;