Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2663498pxb; Tue, 12 Oct 2021 10:53:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4iI9zWn+4zaKMfQHwL/9GXR7wWqbxN2S35/dQTJ0zlmUrGdCWmupq12D/pBmPNP/9yelt X-Received: by 2002:a50:cf86:: with SMTP id h6mr1690030edk.104.1634061238894; Tue, 12 Oct 2021 10:53:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634061238; cv=none; d=google.com; s=arc-20160816; b=CWVxJAc52IVkQncVpnp/Uk42SA22liZJcgqlX8WKxcaxtrRKL8xWP0nuavSQHAsfRc +MTjJ000D/tuQ38s5LtAXrKyPoX8X9By100ztispK/80hBQl35Mf08oHbKKdS0aQiGO8 MEREyZ0QnDt58t5v0XFEpxIO+8M0d2z1VxJtCVFmhAzzj/+JO76JJ8IciU7hgGNN7MQ7 uhdiaP4Mn3WjxhLxc5kFDeOVYpimka8EOEf+hEKnQuAgw+3a8DL/CcnI2qsbkN9ZH0l3 WGG6uEHM/MeXPKAfpGP4vSBu8If5dXf0BU6pLZuVo01Qqq1dIeJmM93Bl/L/BgIBAw2c qjfQ== 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=pVucx63exMbta/kUc+XnMZ4b1vLWpzrYpJgIJcP3lpg=; b=gvc1bfl/8tjyvoC5NK+TwwezT+XC1/EKdxkffYl05gG/WonSU6YuzeHq2xDVUVY+k3 KKu0ZzRLQujLc4qt0pYZBURnMehH9WFrV/6YsSyaqv1DU0XozWwjsa4CJtY/qlIIdKbf aE8fKDTcom/PTuOgUWQQ3Uka0IYLnNZwd1SY5izxkjGcnsQDW0mxQUAFLKtFFN5ivlVl Hj8Zqzd6wnV4q6hG2RFNrZcJRQs7EjsQgmHA7Q9k5TOqdAH+Hw3MtYCv5IRhRZ0C1tud 80vPXW1CsoplZxDxh1eRATgZAIkzvEa587odZVr2fPcMM9mQXErZt56oz/+2P9CROVgM TJAw== 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 bq16si15433851ejb.28.2021.10.12.10.53.34; Tue, 12 Oct 2021 10:53:58 -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 S231691AbhJLRx2 (ORCPT + 99 others); Tue, 12 Oct 2021 13:53:28 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:63658 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbhJLRxR (ORCPT ); Tue, 12 Oct 2021 13:53:17 -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 0f511b32cbeb5915; Tue, 12 Oct 2021 19:51:13 +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 1450C66A819; Tue, 12 Oct 2021 19:51:13 +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 5/7] surface: surface3_power: Use ACPI_COMPANION() directly Date: Tue, 12 Oct 2021 19:46:47 +0200 Message-ID: <3089655.5fSG56mABF@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: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtkedgudduhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdejlefghfeiudektdelkeekvddugfeghffggeejgfeukeejleevgffgvdeluddtnecukfhppedvudefrddufeegrddukeejrdekkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddukeejrdekkedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehhuggvghhovgguvgesrhgvughhrghtrdgtohhmpdhrtghpthhtohepmhhgrhhoshhssehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheplhhuiihmrgigihhmihhlihgrnhes 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 mshw0011_notify() accordingly (no intentional functional impact). Signed-off-by: Rafael J. Wysocki --- drivers/platform/surface/surface3_power.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) Index: linux-pm/drivers/platform/surface/surface3_power.c =================================================================== --- linux-pm.orig/drivers/platform/surface/surface3_power.c +++ linux-pm/drivers/platform/surface/surface3_power.c @@ -160,15 +160,14 @@ mshw0011_notify(struct mshw0011_data *cd { union acpi_object *obj; struct acpi_device *adev; - acpi_handle handle; unsigned int i; - handle = ACPI_HANDLE(&cdata->adp1->dev); - if (!handle || acpi_bus_get_device(handle, &adev)) + adev = ACPI_COMPANION(&cdata->adp1->dev); + if (!adev) return -ENODEV; - obj = acpi_evaluate_dsm_typed(handle, &mshw0011_guid, arg1, arg2, NULL, - ACPI_TYPE_BUFFER); + obj = acpi_evaluate_dsm_typed(adev->handle, &mshw0011_guid, arg1, arg2, + NULL, ACPI_TYPE_BUFFER); if (!obj) { dev_err(&cdata->adp1->dev, "device _DSM execution failed\n"); return -ENODEV;