Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2663758pxb; Tue, 12 Oct 2021 10:54:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi9ONsddVcG/Kc8CR5IQaESXoyxO+gTrsCr7YuvytbgY9FsAdA451GayhGwcPCyWWi7xht X-Received: by 2002:aa7:cb8a:: with SMTP id r10mr1602097edt.237.1634061256229; Tue, 12 Oct 2021 10:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634061256; cv=none; d=google.com; s=arc-20160816; b=qpm5s5O+Pf/ZTZEuAQwJc9nSJYHjkcnAJr+DtUwZs0Uooe7TdIsd0J5XnGCZ6VQet7 gm8Im9v1TXAT89j0Bc8z2FoIpTgNL0NwUivzkchNwFOrwuRHcPhpcmzominzwXf2mKER p6m68YUNMUVsR13gulafadhJB8XpQgsYz+zpdPthtWC1NmTRW32UEFGZtUmMCwjX6LIg ZdZukrqG0KtSqHtJk+nKOkxWFPOyJIjBhIAzJzpdKgLMbI6PYMIGXGMUKe82WPhnqQGG T/UHCVfsREskyvEgD6IYFEUZodnBaChsBZt689I+rRpvTsHEOP/mfuPnOjUFgKA2hU+5 cB3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LFeDeXjx64iGWb/4QWOimHPep7RGrFP3/MT6i/qXwHM=; b=N2upIojFo6hNm28BNjNtZ7DN0Oxfq3rubgURriJXTT7yIKPXW93QfdCuOPxLiEkihl rmIoWZORiVHTrDizJMF3PwAj4ssxQMl55hXlb7S8U7Ak7Zydo5PI2IU4GXHsGl/VqQbh /hTVHzvck8riWanNFJzgVDrVTC9AqVlq6y9IW8WwtMYhRSb8pLCkqrcH7t+8dGCLDrWm sGNeYWnzWezj9wE1PHOser9+mYzTzOFc2GJ+s7RYHw3tnuBDnKEfFb44i2J25O48Q5xF UTESXKF4k7l/qELUnFBE5WDrsSCMFqcrp/y1XvAUTtMl9ZAqg/L73+6/qllYpiejp8q/ OFiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si15594040ejb.382.2021.10.12.10.53.52; Tue, 12 Oct 2021 10:54:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233711AbhJLRxu (ORCPT + 99 others); Tue, 12 Oct 2021 13:53:50 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:42148 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232404AbhJLRxS (ORCPT ); Tue, 12 Oct 2021 13:53:18 -0400 Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 3.0.0) id 1dd9a816cb4bdd57; Tue, 12 Oct 2021 19:51:15 +0200 Received: from kreacher.localnet (unknown [213.134.187.88]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id ABF2D66A81B; Tue, 12 Oct 2021 19:51:14 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Hans de Goede , Mark Gross , Maximilian Luz , platform-driver-x86@vger.kernel.org Subject: [PATCH v1 4/7] surface: surface3-wmi: Use ACPI_COMPANION() directly Date: Tue, 12 Oct 2021 19:44:42 +0200 Message-ID: <3414042.iIbC2pHGDl@kreacher> In-Reply-To: <4369779.LvFx2qVVIh@kreacher> References: <4369779.LvFx2qVVIh@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.187.88 X-CLIENT-HOSTNAME: 213.134.187.88 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtkedguddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdejlefghfeiudektdelkeekvddugfeghffggeejgfeukeejleevgffgvdeluddtnecukfhppedvudefrddufeegrddukeejrdekkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddukeejrdekkedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehhuggvghhovgguvgesrhgvughhrghtrdgtohhmpdhrtghpthhtohepmhhgrhhoshhssehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheplhhuiihmrgigihhmihhlihgrnhes ghhmrghilhdrtghomhdprhgtphhtthhopehplhgrthhfohhrmhdqughrihhvvghrqdigkeeisehvghgvrhdrkhgvrhhnvghlrdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION() macro and the ACPI handle produced by the former comes from the ACPI device object produced by the latter, so it is way more straightforward to evaluate the latter directly instead of passing the handle produced by the former to acpi_bus_get_device(). Modify s3_wmi_check_platform_device() accordingly (no intentional functional impact). Signed-off-by: Rafael J. Wysocki --- drivers/platform/surface/surface3-wmi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) Index: linux-pm/drivers/platform/surface/surface3-wmi.c =================================================================== --- linux-pm.orig/drivers/platform/surface/surface3-wmi.c +++ linux-pm/drivers/platform/surface/surface3-wmi.c @@ -139,13 +139,12 @@ static acpi_status s3_wmi_attach_spi_dev static int s3_wmi_check_platform_device(struct device *dev, void *data) { - struct acpi_device *adev, *ts_adev = NULL; - acpi_handle handle; + struct acpi_device *adev = ACPI_COMPANION(dev); + struct acpi_device *ts_adev = NULL; acpi_status status; /* ignore non ACPI devices */ - handle = ACPI_HANDLE(dev); - if (!handle || acpi_bus_get_device(handle, &adev)) + if (!adev) return 0; /* check for LID ACPI switch */ @@ -159,7 +158,7 @@ static int s3_wmi_check_platform_device( strlen(SPI_CTL_OBJ_NAME))) return 0; - status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1, + status = acpi_walk_namespace(ACPI_TYPE_DEVICE, adev->handle, 1, s3_wmi_attach_spi_device, NULL, &ts_adev, NULL); if (ACPI_FAILURE(status))