Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2683928pxb; Tue, 12 Oct 2021 11:17:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJomQcE5e2zWVnSVt/DkkHbiMG4GthpbnTzGTjJr+md4XaP9Sb1i6F0HRTsy3Q5bSCCI1u X-Received: by 2002:a63:cd09:: with SMTP id i9mr24610670pgg.129.1634062651359; Tue, 12 Oct 2021 11:17:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634062651; cv=none; d=google.com; s=arc-20160816; b=inNywFYekIdeYVxB5CZjIgu4Atcd0cd/I+NQZnTuy6MeACgaW/W0dW8N2Sq4geN8ul CT/c9mta7lCa3xF94aOAgELDXBUBGYueE0PsxAkaIzxrNjXoQFBJO4YUwU6cV6zrph66 vmiP6g/uUt5aCLFz6h4OJAleCco/f2vtEIT61cXDEy+IolXlB888M06Bz9114Bt4rX/4 21HkOOKCvsU7oWCwkDW5p32SLz/3lxvx8ZLgAZcNGsTBzOsQUKmAKdHUrOZPqE220xQ/ H+MK8nvs1oE17bpf5BKaZ0mzjxIp9fps+zXZZ4xM3BLQFcvFCHaFDD0bw/YzS8SxiJmZ I1xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Gbt771FcUpKhRbY7l1qKOaogjRjP2WQTDl1Nm1Sbb5s=; b=j+G4EzRKTZU5w9Zf7y/QCJFQex/MxZhHZRrjY85TJ60s+4fW4OCpzlXPxzz5dnZxZV 5Zh5nFCVvkoPUJXUWYlvboTzv1W7vUShf8QcBnR3/zb48ED4bdAp5WNxhvPaEx1xbmMB ZtXd6Q5qAWpOnQWfFhm6rf4gYN7hF3N9Zh0Ipx0nGA689hVQMR8eP2CFPxZrnfK7R1MF T4WvsMkrK9YQkhhomHnZ0ZJzPuX46e+ByDd3ZrZrl3oORUlKbXUCHcBMPx5fVMHPVcSp 0YnBjDFArrsBs63QOmS8O+VAcYVpk4Y19EjrYjZSaWyojLmy7P+Iaf2sRwIViYpiDdG5 zcTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nR9m8poe; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m14si15257527pls.371.2021.10.12.11.17.06; Tue, 12 Oct 2021 11:17:31 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nR9m8poe; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232876AbhJLSPM (ORCPT + 99 others); Tue, 12 Oct 2021 14:15:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232698AbhJLSPL (ORCPT ); Tue, 12 Oct 2021 14:15:11 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16C78C061570; Tue, 12 Oct 2021 11:13:09 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id a25so2772772edx.8; Tue, 12 Oct 2021 11:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Gbt771FcUpKhRbY7l1qKOaogjRjP2WQTDl1Nm1Sbb5s=; b=nR9m8poegxkbYqSEvu0sGbUleY5y9j4ueU4x0z4zFGBeys0kxAWQ0tARkgRqTqu58Q zfZ9wYkH2kqgTE+0+q6LurNMt2LcMdgnTtt1xDdn9xrPz3s/LY7bz2oD+jWv0XByqj3w jkeyX34/ZnkEtgdP0lvrulDXik6yBqQvRGnfestR3ZuFGUfIuMcMF5qHAjKSTddVcuuO E+C+wmcO3Bd6uqHKYG6MlV21XkeHJmEKiQpJWlg1AdwuLlWxVDboZeXHaxGqoc2dVLIQ SBt06KJjQQG0fEOztcMnlu0HESWOwZsnmPf45daNJV9su55j0pRqyEHuxZp/UowstN+Q SoSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Gbt771FcUpKhRbY7l1qKOaogjRjP2WQTDl1Nm1Sbb5s=; b=RKcw2DsJOTOyUVYjw9osUhC4K9pLzlb6ftXZ0brVTYqrnDI/wnr80Qs/MVZ3zljtPD H+Fl47wwK7lxenIpPB5z29ttAGohxUotZ59O6VyE1Hfuiw+UTy0brWgsIQkS2GC2eUCE UMuA/+B0OwZIBoeHODvSWy6eYJHyvWBQD9qDi5tMYuSsFaZFNxRzD59OUxlq5CPOjyTM iHzh3OMNuP8lIJv1+H4zm8/F52QtayhrQEGz2GQfnBnUBhqkkw+h2SaXbTMonDR1G0qR J6U4Te6KqoZsWnM7+tXAM+cr/3krnTEbSrx2Is5gacT0qPcpRN4lBGHuzhZaiKAIPczy 5UbQ== X-Gm-Message-State: AOAM5302E/4ltMXDs5TS+/t7EBZy7mKm/wsmGHJo2ZuV9Tzqpwo6WtZq dbR1E/PbAIlLzQUQDQfdxMw= X-Received: by 2002:a50:da48:: with SMTP id a8mr1752981edk.146.1634062384153; Tue, 12 Oct 2021 11:13:04 -0700 (PDT) Received: from [10.20.0.4] ([194.126.177.11]) by smtp.gmail.com with ESMTPSA id nd36sm5422846ejc.17.2021.10.12.11.13.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Oct 2021 11:13:03 -0700 (PDT) Message-ID: Date: Tue, 12 Oct 2021 20:13:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v1 4/7] surface: surface3-wmi: Use ACPI_COMPANION() directly Content-Language: en-US To: "Rafael J. Wysocki" , Linux ACPI Cc: LKML , Hans de Goede , Mark Gross , platform-driver-x86@vger.kernel.org References: <4369779.LvFx2qVVIh@kreacher> <3414042.iIbC2pHGDl@kreacher> From: Maximilian Luz In-Reply-To: <3414042.iIbC2pHGDl@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/21 19:44, Rafael J. Wysocki wrote: > 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 Looks good to me. Reviewed-by: Maximilian Luz > --- > 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)) > > >