Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbdHAMLg (ORCPT ); Tue, 1 Aug 2017 08:11:36 -0400 Received: from mailout2.hostsharing.net ([83.223.90.233]:44023 "EHLO mailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbdHAMLe (ORCPT ); Tue, 1 Aug 2017 08:11:34 -0400 X-Mailbox-Line: From 4529edaf2ebe244052426ec10c42f805a343816c Mon Sep 17 00:00:00 2001 Message-Id: <4529edaf2ebe244052426ec10c42f805a343816c.1501570421.git.lukas@wunner.de> In-Reply-To: References: From: Lukas Wunner Date: Tue, 1 Aug 2017 14:10:41 +0200 Subject: [PATCH v4 2/5] ACPI / property: Don't evaluate objects for devices w/o handle To: "Rafael J. Wysocki" Cc: Ronald Tschalaer , Federico Lorenzi , Mika Westerberg , Andy Shevchenko , Leif Liddy , Daniel Roschka , Mark Brown , linux-acpi@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1128 Lines: 34 Fabricated devices such as LNXPWRBN lack a handle, causing evaluation of _CCA and _DSD to always fail with AE_BAD_PARAMETER. While that is merely a (negligible) waste of processing power, evaluating a _DSM for them (such as Apple's device properties _DSM which we're about to add) results in an ugly error: ACPI: \: failed to evaluate _DSM (0x1001) Avoid by not evaluating _DSD and the upcoming _DSM for devices without handle. Cc: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Lukas Wunner --- drivers/acpi/property.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index a65c09cc223f..834e01bee015 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -338,6 +338,9 @@ void acpi_init_properties(struct acpi_device *adev) INIT_LIST_HEAD(&adev->data.subnodes); + if (!adev->handle) + return; + /* * Check if ACPI_DT_NAMESPACE_HID is present and inthat case we fill in * Device Tree compatible properties for this device. -- 2.11.0