Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2599376pxb; Thu, 3 Feb 2022 09:51:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBxn1FszM+yWJdnZ/MVLp9i6VgXx5qef1aTzXs5rBrrVwAVm3GUcYHsc27CSe4bJN8fzP1 X-Received: by 2002:a17:907:94d1:: with SMTP id dn17mr29947689ejc.79.1643910716583; Thu, 03 Feb 2022 09:51:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643910716; cv=none; d=google.com; s=arc-20160816; b=LE4xX0/VKY/u3aa+acqyFR3fWJA5bjLngQ861umeZKYqFTLthGyeVrz5kEP+8ckitr tueFzC+VzjOf5dpPgB4/nz6oNdUzTZFzSmUSCBKnYIT2igqq0CultOxxblx4yfma34CE FfNU+wD9BjHDGOIJsJAjCx/C0DS2gua1UlchB1/gRzFB1+yB4OFXSDW5TKv5Sx1dFOwi xPeBgUR0MeoRDpSXUhAhzQrbg8WVhXblKsp/Jajhr+CvOai+8K3nuf0ciI6adkMgyuup SFFhGm4vn/RkfzQRfJA7yGTwI2bF8G+07Sx9IxR2W4ClF7SvndxrE40xwHIRtFvIHFZ6 XAgw== 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=cqpMoJP79IvTknyTPOWUWx/SZuSXRmK+jiPxSCL+/qE=; b=O4+meUC3r73MXEPtNYc10t7lHs+LQn7O2WZx/sgEX0b+W0bPKCIlvN3+Cpbn3vtbX6 DSAg4WFVUhHysXVL6JJW1ZU8NXxdczOyp8OdT4TwFLjSxMxrfXkTHg3N92ieI2+jrQwb cJwZZKAr9AXD4FY/N/eqbVcgqvWIO40HFVo1Ow04lFgOx/yqWYbfBkF18srT5GXzoO83 VIok/GYSITnJk4vIlGWzvLyIVmGEX4txjD34P7P4d28olhkOgkH6ZuP9pT8wD9V/iys7 E8Z2Gfc46IGVoWTYr3xJ3c/vj7xERmsF7IFr8ZXL9VnqqeUb6/eMhADMthEc0s0hYj2b wU9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v7si13109025edr.373.2022.02.03.09.51.31; Thu, 03 Feb 2022 09:51:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241639AbiBASAq (ORCPT + 99 others); Tue, 1 Feb 2022 13:00:46 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:59810 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233823AbiBASAp (ORCPT ); Tue, 1 Feb 2022 13:00:45 -0500 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 4.0.0) id 3d0df5093a58c7a9; Tue, 1 Feb 2022 19:00:44 +0100 Received: from kreacher.localnet (unknown [213.134.162.64]) (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 8D41766B390; Tue, 1 Feb 2022 19:00:43 +0100 (CET) From: "Rafael J. Wysocki" To: Wolfram Sang Cc: LKML , Linux ACPI , Andy Shevchenko , Mika Westerberg , linux-i2c@vger.kernel.org Subject: [PATCH] i2c: ACPI: Replace acpi_bus_get_device() Date: Tue, 01 Feb 2022 19:00:42 +0100 Message-ID: <4374434.LvFx2qVVIh@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.162.64 X-CLIENT-HOSTNAME: 213.134.162.64 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrgeefgddutdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpefhgedtffejheekgeeljeevvedtuefgffeiieejuddutdekgfejvdehueejjeetvdenucfkphepvddufedrudefgedrudeivddrieegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudeivddrieegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtohepfihsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghnughrihihrdhshhgvvhgthhgvnhhkoheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthho pehmihhkrgdrfigvshhtvghrsggvrhhgsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheplhhinhhugidqihdvtgesvhhgvghrrdhkvghrnhgvlhdrohhrgh 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 Replace acpi_bus_get_device() that is going to be dropped with acpi_fetch_acpi_dev(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/i2c/i2c-core-acpi.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) Index: linux-pm/drivers/i2c/i2c-core-acpi.c =================================================================== --- linux-pm.orig/drivers/i2c/i2c-core-acpi.c +++ linux-pm/drivers/i2c/i2c-core-acpi.c @@ -236,7 +236,8 @@ static int i2c_acpi_get_info(struct acpi struct acpi_device *adapter_adev; /* The adapter must be present */ - if (acpi_bus_get_device(lookup.adapter_handle, &adapter_adev)) + adapter_adev = acpi_fetch_acpi_dev(lookup.adapter_handle); + if (!adapter_adev) return -ENODEV; if (acpi_bus_get_status(adapter_adev) || !adapter_adev->status.present) @@ -275,13 +276,10 @@ static acpi_status i2c_acpi_add_device(a void *data, void **return_value) { struct i2c_adapter *adapter = data; - struct acpi_device *adev; + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); struct i2c_board_info info; - if (acpi_bus_get_device(handle, &adev)) - return AE_OK; - - if (i2c_acpi_get_info(adev, &info, adapter, NULL)) + if (!adev || i2c_acpi_get_info(adev, &info, adapter, NULL)) return AE_OK; i2c_acpi_register_device(adapter, adev, &info); @@ -341,12 +339,9 @@ static acpi_status i2c_acpi_lookup_speed void *data, void **return_value) { struct i2c_acpi_lookup *lookup = data; - struct acpi_device *adev; - - if (acpi_bus_get_device(handle, &adev)) - return AE_OK; + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); - if (i2c_acpi_do_lookup(adev, lookup)) + if (!adev || i2c_acpi_do_lookup(adev, lookup)) return AE_OK; if (lookup->search_handle != lookup->adapter_handle)