Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1646303pxb; Wed, 9 Feb 2022 01:04:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUA4Sb0UOAyZGhoTQRZ5jtD9gKl2h1qX8pMqD0D9SBDb5sdQcwIpsfzd1rMX9UepibZHWE X-Received: by 2002:a65:424d:: with SMTP id d13mr1134594pgq.82.1644397480381; Wed, 09 Feb 2022 01:04:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644397480; cv=none; d=google.com; s=arc-20160816; b=A/EXuNhkqBZi/DIZ35Z08s7cwOT+jHXixaI20s+oAgASmjB0fzv/33JQgFjxykgYIt wled0GBAyBOZPmHO42x08T+jVh8hFhEZPSf3dbrTvZHHL2Qwejv2Ksp7U+DBR8VC6HhF 18DX3SZucoEvINOAgU8KF6doAho98GuqoEGUdC/1HHkXoa/2Xaxysw53RbmUmdHkpAaW Rw97Gzq2kApHB2RAiM9X8Nuz6ZLsXRojEDG+0uVxTG3B0rsupyA5ayu6wHE4IRadE3K/ B6WBLQ3NJInyMRaXp57Kns397i6Ee5nXiiarnHsltCaASVJb5fscY2AN+K/IGYRA2e5z k9lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=P3IFXyuoE3g/iRKQHqzF+7ZP9XXyqIHsjJJ3rMeBzeI=; b=tepKAigVfK6GumBXrw8LpjAHS+tGjFquQEIDKBXlMm3QOS85kD4+wIaiWa/4C9Ezi3 zD4bmaO/EmWjbwqJ6nT3r2/F4vMu5kAC80bQCDJ+M9zFZDPZt4WhqTMFpVmGsWmoyVro NLuE3UI+RsiTP5Cz9i4CKIpv0tso/TWUJnuISqGm6PbVp3l2c4kAAWCtWTN+fQLi9+Zd cPMAO7iPhlpE4zHUxpI1NFWwVK4A7PMI9JDudbv0NcVh3ee5Qy9QWDEYmZ53c3TXGHNC MHYLDJyH+mhw5tsVqR4Dirhvx1cfV+101WrvGCSQGug8wCeeyMjcF+ykQiloV0pRh6yz tnhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ktZ8UwMt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mh13si5466731pjb.155.2022.02.09.01.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 01:04:40 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ktZ8UwMt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 21BDEE018E61; Wed, 9 Feb 2022 00:50:20 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377870AbiBDXOu (ORCPT + 99 others); Fri, 4 Feb 2022 18:14:50 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:55932 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376312AbiBDXOt (ORCPT ); Fri, 4 Feb 2022 18:14:49 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 67DA1B83967; Fri, 4 Feb 2022 23:14:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6035C004E1; Fri, 4 Feb 2022 23:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644016487; bh=MYi9IiU+yOAAJGTml3/Ykmnyb/j5FaPAwu6TFeCrUZk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ktZ8UwMt+zeZvooJjXKnCO2gqgxOWADcs8ome7KbMkZu4Mybjenx7sWEHRUj9Ag0h 7hzbyt11+9DkMT/xI/jtxBszrD68q/kvf2/gl7j2ibb9n1pn87xGLvDxI6n+QiLWuD FJOGGOvj6jZaubCYmgoWrBFJJ9RoP/VM72fvN+8BqWrebs6+JQql9vQpc10Xo4BoiI a/qvT8H0RuKjRv+gHfXtpWigxr1kPJZUi21FYNvP5/PCUff3/JMhPx+hjqPWdkIoTZ eeb0oLDXwjeD0iK18DQNll9rFUDaD0woS+PEZy3qeVWED/QzykAvMRoHgqJTd6aEUV 7LiXFGha71Gkg== Date: Fri, 4 Feb 2022 17:14:44 -0600 From: Bjorn Helgaas To: "Rafael J. Wysocki" Cc: Mika Westerberg , Linux PCI , Linux ACPI , LKML Subject: Re: [PATCH v2] PCI: ACPI: Replace acpi_bus_get_device() Message-ID: <20220204231444.GA228064@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11930209.O9o76ZdvQC@kreacher> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Thu, Jan 27, 2022 at 12:40:13AM +0100, Rafael J. Wysocki wrote: > 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 Applied with Mika's Reviewed-by to pci/acpi for v5.18, thanks! > --- > > -> v2: Fix typo (superfluous paren) in acpiphp_ibm.c. > > --- > drivers/pci/hotplug/acpiphp_glue.c | 7 ++++--- > drivers/pci/hotplug/acpiphp_ibm.c | 5 +++-- > drivers/pci/pci-acpi.c | 6 +++--- > 3 files changed, 10 insertions(+), 8 deletions(-) > > Index: linux-pm/drivers/pci/hotplug/acpiphp_glue.c > =================================================================== > --- linux-pm.orig/drivers/pci/hotplug/acpiphp_glue.c > +++ linux-pm/drivers/pci/hotplug/acpiphp_glue.c > @@ -226,9 +226,9 @@ static void acpiphp_post_dock_fixup(stru > static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data, > void **rv) > { > + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); > struct acpiphp_bridge *bridge = data; > struct acpiphp_context *context; > - struct acpi_device *adev; > struct acpiphp_slot *slot; > struct acpiphp_func *newfunc; > acpi_status status = AE_OK; > @@ -238,6 +238,9 @@ static acpi_status acpiphp_add_context(a > struct pci_dev *pdev = bridge->pci_dev; > u32 val; > > + if (!adev) > + return AE_OK; > + > status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); > if (ACPI_FAILURE(status)) { > if (status != AE_NOT_FOUND) > @@ -245,8 +248,6 @@ static acpi_status acpiphp_add_context(a > "can't evaluate _ADR (%#x)\n", status); > return AE_OK; > } > - if (acpi_bus_get_device(handle, &adev)) > - return AE_OK; > > device = (adr >> 16) & 0xffff; > function = adr & 0xffff; > Index: linux-pm/drivers/pci/hotplug/acpiphp_ibm.c > =================================================================== > --- linux-pm.orig/drivers/pci/hotplug/acpiphp_ibm.c > +++ linux-pm/drivers/pci/hotplug/acpiphp_ibm.c > @@ -433,8 +433,9 @@ static int __init ibm_acpiphp_init(void) > goto init_return; > } > pr_debug("%s: found IBM aPCI device\n", __func__); > - if (acpi_bus_get_device(ibm_acpi_handle, &device)) { > - pr_err("%s: acpi_bus_get_device failed\n", __func__); > + device = acpi_fetch_acpi_dev(ibm_acpi_handle); > + if (!device) { > + pr_err("%s: acpi_fetch_acpi_dev failed\n", __func__); > retval = -ENODEV; > goto init_return; > } > Index: linux-pm/drivers/pci/pci-acpi.c > =================================================================== > --- linux-pm.orig/drivers/pci/pci-acpi.c > +++ linux-pm/drivers/pci/pci-acpi.c > @@ -89,9 +89,9 @@ int acpi_get_rc_resources(struct device > return -ENODEV; > } > > - ret = acpi_bus_get_device(handle, &adev); > - if (ret) > - return ret; > + adev = acpi_fetch_acpi_dev(handle); > + if (!adev) > + return -ENODEV; > > ret = acpi_get_rc_addr(adev, res); > if (ret) { > > >