Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3609627pxb; Wed, 13 Oct 2021 09:18:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwylVAXaiUbPac4CHQRMQ2noveRpgSWSr8fTC9f59M3uV518s6fz9eA3J1UXOH/eKckRAI3 X-Received: by 2002:a62:60c2:0:b0:448:7376:20c4 with SMTP id u185-20020a6260c2000000b00448737620c4mr39275104pfb.11.1634141929666; Wed, 13 Oct 2021 09:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634141929; cv=none; d=google.com; s=arc-20160816; b=YHCG7Nswfo6v2rWXZGGW8TDkeUkk6aA749JunBrLlssXjnoabKuY4aY+s9whQ+Rjbb VLxR5DcOQZ6mwvJkXYVomUA0U9QPuNlCmoOmvP5ew+S6yDdTH1MXzRluXOs5z84bpdsl lu3vTbYziX4Vn1fzgf3JnCH9fG+frI7tdumJooLn7ex1Ej94iTRqLw/JPg4sqs8RpmmX p7wZQvOcGeORoNKBVwD/VY9adIUKsTFZAaBfwb+42coMJgLRInOVdp9iV1zo+upwaqif +eRSYFaksWDRsOO6Ogrmf61SyMaKuR5Eyi5cenwxHgatYKjZVrNcVXWkE8PtMw7/COdI A1aQ== 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=mJy3Sn/+Yz70e2bCgJxteATuA+Lmdf9OCn8pIdyi9SM=; b=VZYVgKPAAchjMyD/63it1oRZiP2jYLuuu95rkbLao0z/DXXjeQHpn0nynHNRkd6Zab 66Ylj3aqDZrn9B4zKX3gMjaHNelTZF5k5qHJUJb+pSpY6lJ+4o0Hx1d/m+zHgwgXHnxn 3ILkPQslS+U9HgvzOUgoHek/qgYpzc0aqJMYEvH+TKD5SDcSXWwQWtHOhxmGnElrLIFs qi2lIsk0Zbz87ROO/BVLgmY7nKdJ59oOzfCSAOvynt8M15IhwlqRrAHUIZ/0xUSsOHor IVzl7IGNQJdAKn19iZpdHt8pigdAbgOCigJ2f0J8CUrtixTeDFFAjsVdcKPyYxSlfnj6 2qDA== 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 q7si18793pjg.18.2021.10.13.09.18.02; Wed, 13 Oct 2021 09:18:49 -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 S234505AbhJMQSk (ORCPT + 99 others); Wed, 13 Oct 2021 12:18:40 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:43174 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbhJMQSg (ORCPT ); Wed, 13 Oct 2021 12:18:36 -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 00be1698bc0238fb; Wed, 13 Oct 2021 18:16:31 +0200 Received: from kreacher.localnet (unknown [213.134.161.244]) (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 2F23B66A871; Wed, 13 Oct 2021 18:16:31 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Ike Panhc , Hans de Goede , platform-driver-x86@vger.kernel.org Subject: [PATCH v2 6/7] platform: x86: ideapad-laptop: Use ACPI_COMPANION() directly Date: Wed, 13 Oct 2021 18:13:51 +0200 Message-ID: <8000884.T7Z3S40VBb@kreacher> In-Reply-To: <1727796.VLH7GnMWUR@kreacher> References: <4369779.LvFx2qVVIh@kreacher> <1727796.VLH7GnMWUR@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.161.244 X-CLIENT-HOSTNAME: 213.134.161.244 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrvddutddgleeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvjeelgffhiedukedtleekkedvudfggefhgfegjefgueekjeelvefggfdvledutdenucfkphepvddufedrudefgedrudeiuddrvdeggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrdduiedurddvgeegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepihhkvgdrphgrnhestggrnhhonhhitggrlhdrtghomhdprhgtphhtthhopehhuggvghhovgguvgesrhgvughhrghtrdgtohhmpdhrtghpthhtohepphhlrghtfhhorhhmqdgurhhivhgv rhdqgiekieesvhhgvghrrdhkvghrnhgvlhdrohhrgh 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 --- v1 -> v2: * Resend with a different From and S-o-b address. No other changes. --- 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);