Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3318929pxb; Sat, 9 Oct 2021 07:25:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPm4OOb6GQ9dvtEjmK514m3H+4Z03x00lgLTCy25EUc4QMPXw12wsrOkTedOFmRpG0otqG X-Received: by 2002:a17:906:2f94:: with SMTP id w20mr12438066eji.14.1633789541877; Sat, 09 Oct 2021 07:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633789541; cv=none; d=google.com; s=arc-20160816; b=uNz5p7zEZHjgp7t7KPh6nzS3dqnD7AMYvPKdJMUNh6mnc6zc/Qt2gpiv8xGUu68oSv RR32GKVEYQgka3Bw4FnlVk2X+6kYb6klkzf3czsfArqVBpt5CEb6TmfD6fymqjt6Pe3K /wyEOaXCwqrnNNjZ6nojZY66pAx5w2L0ARxgoq4rSwPDIY5mOc34qiAE7IdKAJKIaG8x YRwa/LgiHdEU/e1EeVPs8TEYEw3RIXtCoySEdjujt9N4ArmZdzYErN8eygKc41y/m3aF WBqXP3tXNjnk9e1UbJWveuzIimf6HgiUkDF2hX3fyjW1WkZxZyhfAmIsKOMU1IPQuGqr C+PA== 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 :message-id:date:subject:cc:to:from; bh=ciWEx7siIbt3dQcf9whfLgFXSLva9oZ33cd/aUEuzHI=; b=TuDDclSOWOTJRgTB942HGZMaeya5TivuRbL3UDS6ClUK0DdGN9uS12BRFqfs0XAejG gn/ksHuSY9IHMdKP4Im8RUxyDrr9R6tNN5h9UDbLX5QIYHzK0Dw49tH2TQx0XBHuwd9g octkFsk2ZEkcbpKTvATxS79J4rk9w1hY3NMYDu/5rxR64iABZmy0wj5wjAlGs6NvjGps IPo/DATywq/oe/Cv21Qkt9A1JvgbwjeThwWskigkaG9AJ8+oxNOaToYMFH0V8mAp40VL D3QREDzF+BMatuSRkiW/tAuo7NoH6i2wBqraxf0FpWh9PIrX7jIKVVj7rDaG473Ae4us /uFQ== 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 y2si3470703ejr.90.2021.10.09.07.25.18; Sat, 09 Oct 2021 07:25:41 -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 S234126AbhJIOZz (ORCPT + 99 others); Sat, 9 Oct 2021 10:25:55 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:41572 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233093AbhJIOZz (ORCPT ); Sat, 9 Oct 2021 10:25:55 -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 b706c1e87c7be95f; Sat, 9 Oct 2021 16:23:57 +0200 Received: from kreacher.localnet (89-77-51-84.dynamic.chello.pl [89.77.51.84]) (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 5DB4C66A755; Sat, 9 Oct 2021 16:23:56 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: Andy Shevchenko , LKML , Mika Westerberg Subject: [PATCH] ACPI: LPSS: Use ACPI_COMPANION() directly Date: Sat, 09 Oct 2021 16:23:55 +0200 Message-ID: <4687529.31r3eYUQgx@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 89.77.51.84 X-CLIENT-HOSTNAME: 89-77-51-84.dynamic.chello.pl X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtvddgjeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpefhgedtffejheekgeeljeevvedtuefgffeiieejuddutdekgfejvdehueejjeetvdenucfkphepkeelrdejjedrhedurdekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeekledrjeejrdehuddrkeegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghnughrihihrdhshhgvvhgthhgvnhhkoheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehmihhkrgdrfigvshhtvghrsggvrhhgsehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=4 Fuz1=4 Fuz2=4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki The ACPI_HANDLE() macro returns the ACPI handle of the ACPI device object returned by the ACPI_COMPANION() macro, so it is more straightforward to evaluate the latter directly instead of passing the handle produced by the former to acpi_bus_get_device(). Modify the code accordingly (no intentional functional impact). Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_lpss.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) Index: linux-pm/drivers/acpi/acpi_lpss.c =================================================================== --- linux-pm.orig/drivers/acpi/acpi_lpss.c +++ linux-pm/drivers/acpi/acpi_lpss.c @@ -712,14 +712,13 @@ static void __lpss_reg_write(u32 val, st static int lpss_reg_read(struct device *dev, unsigned int reg, u32 *val) { - struct acpi_device *adev; + struct acpi_device *adev = ACPI_COMPANION(dev); struct lpss_private_data *pdata; unsigned long flags; int ret; - ret = acpi_bus_get_device(ACPI_HANDLE(dev), &adev); - if (WARN_ON(ret)) - return ret; + if (WARN_ON(!adev)) + return -ENODEV; spin_lock_irqsave(&dev->power.lock, flags); if (pm_runtime_suspended(dev)) { @@ -1266,7 +1265,8 @@ static int acpi_lpss_platform_notify(str if (!id || !id->driver_data) return 0; - if (acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev)) + adev = ACPI_COMPANION(&pdev->dev); + if (!adev) return 0; pdata = acpi_driver_data(adev);