From patchwork Fri Jun 16 04:40:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= X-Patchwork-Id: 9790499 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1380B60326 for ; Fri, 16 Jun 2017 04:41:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 120972855C for ; Fri, 16 Jun 2017 04:41:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0744728608; Fri, 16 Jun 2017 04:41:53 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 B581C2855C for ; Fri, 16 Jun 2017 04:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750792AbdFPElj (ORCPT ); Fri, 16 Jun 2017 00:41:39 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:34299 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752037AbdFPElR (ORCPT ); Fri, 16 Jun 2017 00:41:17 -0400 Received: by mail-wr0-f194.google.com with SMTP id y25so3107388wrd.1 for ; Thu, 15 Jun 2017 21:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TXj+DfWs/gHutAAMb7unlG7aF2HY6XdETe7WYttVsiw=; b=r6g2XamBL0KmXlZgWsGlNftqru0vpto6I7BMH0JJ89PnwTmVo81a+Idolg6Nke6qSr bxB6TJeaST1BrcxxveffQ2/l7oSAaM93XhWA6FM4K8siXGTbjv6QtT0CWO3V+3I5IL/x 43SKwxkUBbzTikTwfGlOF8MwJxut6orf8C1zI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TXj+DfWs/gHutAAMb7unlG7aF2HY6XdETe7WYttVsiw=; b=ibXHUtPM5bW991sBCeQWTo7WyoiwsNBRmmLXrvcyvB3fBM4iobEW7pc+eDxUFO1faQ LJPfiD2oHr+sBrIxbwujmKjy/mrrQonZ7ydpKciv7CHy9Haqf6/gqp7aZGtEO/iei18V Peu4mcjBVJrCw5DHt3cobPSvw8dsEBmCvpzz2NOpN/hYqlubRMYxYFE+hzM8nmd7G9fK gjDvKL/A2cIUSV10SbnRUMtYYfuEJ24qi5kfwFPwxynHaTyYtT3evWr3ANpc5NkIhV/f d3NV2UnlocYBoUdAXpRbD813vl3AlYPrcxqwvSgOvKECFSqtfu9WDxaewygG7wRl7ykt j5jg== X-Gm-Message-State: AKS2vOxW4SndufbkfDob8F40Hb+Lmz0KKA0TMrA6+zjBGB5ThZKMr19P ej0BLzD9Vu03bJ39 X-Received: by 10.223.171.226 with SMTP id s89mr3669201wrc.38.1497588076020; Thu, 15 Jun 2017 21:41:16 -0700 (PDT) Received: from kmp-mobile.hq.kempniu.pl (kmp-mobile.hq.kempniu.pl. [2001:470:64df:111::2d90]) by smtp.googlemail.com with ESMTPSA id g3sm2026681wrd.11.2017.06.15.21.41.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 21:41:15 -0700 (PDT) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Jonathan Woithe , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] platform/x86: fujitsu-laptop: do not evaluate ACPI _INI methods Date: Fri, 16 Jun 2017 06:40:57 +0200 Message-Id: <20170616044058.30443-7-kernel@kempniu.pl> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170616044058.30443-1-kernel@kempniu.pl> References: <20170616044058.30443-1-kernel@kempniu.pl> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP acpi_ns_initialize_devices(), which is called during system-wide ACPI initialization, already detects and calls all _INI methods belonging to objects present in ACPI tables. There is no need to call these methods again every time the module is loaded because they only initialize status flags and hotkey-related variables; status flags are effectively constants, hotkey-related variables may be assigned non-zero values before acpi_fujitsu_laptop_add() is called, but that does not really matter as we drain the scancodes queued in the firmware's ring buffer before doing anything else. Remove sections of code which invoke and check evaluation status of the _INI methods belonging to the ACPI devices handled by the driver. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index b9f3ede4d567..0861be36305d 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -421,14 +421,6 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) pr_info("ACPI: %s [%s]\n", acpi_device_name(device), acpi_device_bid(device)); - if (acpi_has_method(device->handle, METHOD_NAME__INI)) { - vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n"); - if (ACPI_FAILURE - (acpi_evaluate_object - (device->handle, METHOD_NAME__INI, NULL, NULL))) - pr_err("_INI Method failed\n"); - } - if (get_max_brightness(device) <= 0) priv->max_brightness = FUJITSU_LCD_N_LEVELS; get_lcd_level(device); @@ -801,14 +793,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) pr_info("ACPI: %s [%s]\n", acpi_device_name(device), acpi_device_bid(device)); - if (acpi_has_method(device->handle, METHOD_NAME__INI)) { - vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n"); - if (ACPI_FAILURE - (acpi_evaluate_object - (device->handle, METHOD_NAME__INI, NULL, NULL))) - pr_err("_INI Method failed\n"); - } - i = 0; while (call_fext_func(device, FUNC_BUTTONS, 0x1, 0x0, 0x0) != 0 && (i++) < MAX_HOTKEY_RINGBUFFER_SIZE)