Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1610024ybf; Thu, 27 Feb 2020 14:28:06 -0800 (PST) X-Google-Smtp-Source: APXvYqy4Yx9g8pm+o++XzjXwyOAJBo7QOo7fD/BukDQVGGkZIh2yzsIyRmyResO5vsdbVKPelu9q X-Received: by 2002:aca:5194:: with SMTP id f142mr1022341oib.100.1582842486077; Thu, 27 Feb 2020 14:28:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582842486; cv=none; d=google.com; s=arc-20160816; b=AR9YGkdP7h/KVPVMVSqax5atvdd1MoM1HDr/eKQcWATpS3/h/AsR2tH4+gdwOXnbqt qvm5JkPvrDKoCsaSok7nKnMv7z07BbgNRpbNG6bmwU+ZNCDTTGzsfg/dgSZ8PKd/rW/U hLuRoAdtH048pPL8uXsRk2cvESZO87KWJKIyfTkft4tq9Bifuoa/ybSElm56kKULwYsP R9yAka4S30f6GWncfPceFn+KV4PFjexe4GRlDd0M0B/ptpD9DUpKKdVN4DHaP27PP8oX GtFr10IXCHmbHlUSP2Kl32+UEaU7VTanlCxB5PetlfU4WI2b0XkU621P+fKKCSrmrlK/ hMYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=d6YglfuxDS1iDim/s3wRgZ+vRcQZHTz0KMYTPlSkWy0=; b=n1WMAW/qraLnzgvLKyi5Xb0X/eSkRPBtf0GYyG8DxQx4b2eyBoFrJUc7UUu64yfj10 xkVedu9rBwRpiNd3WJIOlcG5TUbwVY5juR56M0SXVVoGvTD7/guYOZfizvgYaEX8pwuZ Z3ULYRFqmh7GVlee71HGPcYnvqflSxcJhEK0zch0qHO14RYYJfifG07KVuN3pOuYLgfy fnp+LypiarxnFlq9rgE0W/8jgIqjEOqJm/mTxqa5c8w27vpUBjSAmIFYoLIIzGUydyDP kAU1XcxZJLmAk1N0HbfyqsvmA8p4iyZhovrMRcuwmNKvMhSCBvbg62PJ0K8tjyi2Pl4s cU3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si607640oij.107.2020.02.27.14.27.51; Thu, 27 Feb 2020 14:28:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729947AbgB0WZT (ORCPT + 99 others); Thu, 27 Feb 2020 17:25:19 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:44963 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729434AbgB0WZT (ORCPT ); Thu, 27 Feb 2020 17:25:19 -0500 Received: from 79.184.237.30.ipv4.supernova.orange.pl (79.184.237.30) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.341) id 5a3ee59d053df584; Thu, 27 Feb 2020 23:25:17 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , "Rafael J. Wysocki" , Daniel Drake Subject: [PATCH 6/6] ACPI: EC: Use fast path in acpi_ec_add() for DSDT boot EC Date: Thu, 27 Feb 2020 23:24:14 +0100 Message-ID: <13529563.7la0fBEcfz@kreacher> In-Reply-To: <2094703.CetWLLyMuz@kreacher> References: <2094703.CetWLLyMuz@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Rafael J. Wysocki" If the boot EC comes from the DSDT, its ACPI handle is equal to the handle of a device object with the PNP0C09 device ID. If that device object is passed to acpi_ec_add(), it is not necessary to allocate a new EC structure for it and parse it, because that has been done already, so change the function to use the fast path in that case. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/ec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 4ed0c6155d3f..920a08c01ab6 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1614,7 +1614,8 @@ static int acpi_ec_add(struct acpi_device *device) strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_EC_CLASS); - if (!strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) { + if ((boot_ec && boot_ec->handle == device->handle) || + !strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) { /* Fast path: this device corresponds to the boot EC. */ ec = boot_ec; } else { -- 2.16.4