Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2663407pxb; Tue, 12 Oct 2021 10:53:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4Ze1vbnEzCesqd+ceO1IWjnM0fdB5iSKdjcjoeHO+k9uM6l1E68Z+WZFxR2ZRbEuItkeK X-Received: by 2002:aa7:c945:: with SMTP id h5mr1650358edt.350.1634061230512; Tue, 12 Oct 2021 10:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634061230; cv=none; d=google.com; s=arc-20160816; b=yvmw3PaR73EzrweNhhjDW6ieTHlAwMMblEhs6UvRqotOUyzNd/0aAPfUd4Hpu5+KSj UPUdGF9zAVxMKZ4bK9oGSU1hianl3xeRrrA56mxHyXP+Mr5FYkc88RRqq07WXEFs6jd8 lWLzO7Ws66ohGScabgO5rXqlicdt07d3Ycq2bzBUHfDpbb6SnEgHEx4gFyw3cT811U7z rFQFllKGKTxyz4RoEpkkjz9OZOfGB27+y9fyvwQaGNvQFd962LpaQmDUSF3fgxAP+5GQ 1XeHb+Sz8CqPacAPJr6nB+Ms+0cGbDMi0K6EMo6dIf0YtareFYK+KkchJdpbZ/gY1K1Y fiuw== 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=o+73KvBaC7ORLmYIHcLQhb4ZDo0WPx7H9OxzfEY1gkA=; b=tyYXN3tCqm1tg+SIEnJQl8XPRR7OnJjB5znD+cUmeCGUTv/OFT6smE5FmgEZydx6TL xxsleHgtC1MyAol6iB+l/oGZERrvhMGyJQx0PUJaqwtRWA9CUTKGBvCTW4NG1StpRbSr tKKLeQxfiKG3YSFYnFr8Nk4H/0la3lG+6qeLC63+P1BsZ41/FwrlBysa4lZ25tY5VK7t o6Hv6SkoffqOWSUvgtHBsDlHQFqeidUCuqupbRbDBwFCCVlxrR7xFkadgQxlp+zXPT5I CS92tcBnUWvd4fIv2ffgbqhHCTea2drjdFpsjyRKZa7X6H5mb0X2csH3jSa6i1wZ0Gfl dJwQ== 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 u6si13587313edq.5.2021.10.12.10.53.26; Tue, 12 Oct 2021 10:53:50 -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 S233127AbhJLRxZ (ORCPT + 99 others); Tue, 12 Oct 2021 13:53:25 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:44448 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232851AbhJLRxP (ORCPT ); Tue, 12 Oct 2021 13:53:15 -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 717a687e2ae63d70; Tue, 12 Oct 2021 19:51:12 +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 7263066A819; Tue, 12 Oct 2021 19:51:11 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Ike Panhc , Hans de Goede , platform-driver-x86@vger.kernel.org Subject: [PATCH v1 6/7] platform: x86: ideapad-laptop: Use ACPI_COMPANION() directly Date: Tue, 12 Oct 2021 19:48:23 +0200 Message-ID: <1727796.VLH7GnMWUR@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: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtkedgudduhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdejlefghfeiudektdelkeekvddugfeghffggeejgfeukeejleevgffgvdeluddtnecukfhppedvudefrddufeegrddukeejrdekkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddukeejrdekkedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehikhgvrdhprghnsegtrghnohhnihgtrghlrdgtohhmpdhrtghpthhtohephhguvghgohgvuggvsehrvgguhhgrthdrtghomhdprhgtphhtthhopehplhgrthhfohhrmhdqughrihhvvghr qdigkeeisehvghgvrhdrkhgvrhhnvghlrdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 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 ideapad_acpi_add() accordingly (no intentional functional impact). Signed-off-by: Rafael J. Wysocki --- drivers/platform/x86/ideapad-laptop.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) Index: linux-pm/drivers/platform/x86/ideapad-laptop.c =================================================================== --- linux-pm.orig/drivers/platform/x86/ideapad-laptop.c +++ linux-pm/drivers/platform/x86/ideapad-laptop.c @@ -1534,17 +1534,13 @@ static void ideapad_check_features(struc static int ideapad_acpi_add(struct platform_device *pdev) { + struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); struct ideapad_private *priv; - struct acpi_device *adev; acpi_status status; unsigned long cfg; int err, i; - err = acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev); - if (err) - return -ENODEV; - - if (eval_int(adev->handle, "_CFG", &cfg)) + if (!adev || eval_int(adev->handle, "_CFG", &cfg)) return -ENODEV; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);