Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1020464pxb; Wed, 6 Apr 2022 06:55:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvv/Cf65WfdWSEgZMEydqQBthflPyFuC9ceU8kTGSlixDmZkmff7rw+LMnN1QdpFFFlsFF X-Received: by 2002:a63:ae48:0:b0:386:2e2a:c16a with SMTP id e8-20020a63ae48000000b003862e2ac16amr7214936pgp.59.1649253305386; Wed, 06 Apr 2022 06:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649253305; cv=none; d=google.com; s=arc-20160816; b=TqJ6QNRzFaW6LMlZ/Od44brkwbcnvXjExLwWfyk7g4eGBJH8z03GJ8sHjCj1ahVifB +L3h6O8p0auZxTu4pipg9QxphGEVy39WNJrEygiLJ6+eV4pMB1ORNzIOmwrAEnfHDIl8 ZvYz/Kv/TEneY8KwL4dNrFU9vICbFC0Wgh/tDiNSkBETR7Gr0g5sWs6+bi+FRbeXyhut D4Chc0cjbSCkiBcLKU4jdsQR7OeahDN5Gjg/yOm8AmHZtOVx/51bt7d5t+CvQ0HM0Rki vVhx0jYQOZMKjfZ8bugos+zCAh0RWAhJGQfLgrTQZ1lEBvKaR76jfDER1CBzgYCXeIJ6 rQGA== 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=4+JmmzUP789FgBBlDy773DnKt7EmZ0TRX+KaI7C+60E=; b=q5oZ7zZveab2K9T0kdhAW63OxNmDzdK5guV3spqs8X9d4n0PJtgnpAiXcT5YE4XtCB 1j0WuuCDU1A6TZH1QOzOMEvEv6v10PDrU6eMoVc+YnixluCLA2nxujx0TjpwXRKvejmB 4lcJaUGYLj9oNJO31J1X3YfwevoB2ufHpId4wKhEh0nQKcmHtmMUa413qS9OXgl9K0Fp EDUkdbDvaGpzwKq1DgZaYgyJgBV/m1Y5F8rNcL4zEx09NBiBGDr4gucCdX1lE8tpS487 37gwhFj5x8liOgHTi7swQsj7LB4heEkuqWyko0Ugs1RhPyFwC+jsI0C9Hqa+v/lHXzXg b50g== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i24-20020a631318000000b003995ad9a355si5752916pgl.545.2022.04.06.06.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:55:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25613574149; Wed, 6 Apr 2022 04:48:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1577824AbiDEXRB (ORCPT + 99 others); Tue, 5 Apr 2022 19:17:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1457915AbiDEQ7M (ORCPT ); Tue, 5 Apr 2022 12:59:12 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C618B4A915; Tue, 5 Apr 2022 09:57:13 -0700 (PDT) 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 5.0.0) id 742f0ee565e3f865; Tue, 5 Apr 2022 18:57:12 +0200 Received: from kreacher.localnet (unknown [213.134.181.136]) (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 8220B66BCB7; Tue, 5 Apr 2022 18:57:11 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Mark Brown , linux-spi@vger.kernel.org Subject: [PATCH v1] ACPI: bus: Eliminate acpi_bus_get_device() Date: Tue, 05 Apr 2022 18:57:10 +0200 Message-ID: <5817980.lOV4Wx5bFT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.181.136 X-CLIENT-HOSTNAME: 213.134.181.136 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudejgedguddtfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhephfegtdffjeehkeegleejveevtdeugfffieeijeduuddtkefgjedvheeujeejtedvnecukfhppedvudefrddufeegrddukedurddufeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudekuddrudefiedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepgedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegsrhhoohhnihgvsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhsphhisehvghgvrhdrkhgvrhhnvghlrdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=4 Fuz1=4 Fuz2=4 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Replace the last instance of acpi_bus_get_device(), added recently by commit 87e59b36e5e2 ("spi: Support selection of the index of the ACPI Spi Resource before alloc"), with acpi_fetch_acpi_dev() and finally drop acpi_bus_get_device() that has no more users. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/scan.c | 13 ------------- drivers/spi/spi.c | 3 ++- include/acpi/acpi_bus.h | 1 - 3 files changed, 2 insertions(+), 15 deletions(-) Index: linux-pm/drivers/spi/spi.c =================================================================== --- linux-pm.orig/drivers/spi/spi.c +++ linux-pm/drivers/spi/spi.c @@ -2406,7 +2406,8 @@ static int acpi_spi_add_resource(struct } else { struct acpi_device *adev; - if (acpi_bus_get_device(parent_handle, &adev)) + adev = acpi_fetch_acpi_dev(parent_handle); + if (!adev) return -ENODEV; ctlr = acpi_spi_find_controller_by_adev(adev); Index: linux-pm/include/acpi/acpi_bus.h =================================================================== --- linux-pm.orig/include/acpi/acpi_bus.h +++ linux-pm/include/acpi/acpi_bus.h @@ -511,7 +511,6 @@ extern int unregister_acpi_notifier(stru * External Functions */ -int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); struct acpi_device *acpi_fetch_acpi_dev(acpi_handle handle); acpi_status acpi_bus_get_status_handle(acpi_handle handle, unsigned long long *sta); Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -588,19 +588,6 @@ static struct acpi_device *handle_to_dev return adev; } -int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) -{ - if (!device) - return -EINVAL; - - *device = handle_to_device(handle, NULL); - if (!*device) - return -ENODEV; - - return 0; -} -EXPORT_SYMBOL(acpi_bus_get_device); - /** * acpi_fetch_acpi_dev - Retrieve ACPI device object. * @handle: ACPI handle associated with the requested ACPI device object.