From patchwork Thu Feb 4 17:28:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 8226051 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8BE749F8AA for ; Thu, 4 Feb 2016 17:33:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6E4920108 for ; Thu, 4 Feb 2016 17:33:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 163F0203A0 for ; Thu, 4 Feb 2016 17:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966606AbcBDRcw (ORCPT ); Thu, 4 Feb 2016 12:32:52 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:34704 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966507AbcBDR3b (ORCPT ); Thu, 4 Feb 2016 12:29:31 -0500 Received: by mail-wm0-f50.google.com with SMTP id 128so37643192wmz.1 for ; Thu, 04 Feb 2016 09:29:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z+sTJafYM5OEQ9HbdnyG6XAsGqsE9OBqzMuHqiUWL3s=; b=dZU3QBgfFhBTPwW5CapQA9JJrSrQ22o5k1NlrVEgk82EeK8MtVXah0lC0reF637Xlu +npPaqajT2U6z1HuT/zKWDUt2SNIK6dpBdRCWeLdxhPqgauRSIOSnb5GlwEBgTCo7mkY x1zAKT4ogrIb4vjLMy2dI7nSzTMR+u6dxaW4mmQ8pxecZPXaVr8CTVLu2ApvJ7iR50WY 2iMEml0C4+Pvq6a8KPlQYWu1e1TnCsYEiPjPTYwUIGjWHwK1oJQwIbimfItlTviAsXMP u9/dwnhu+SRGXT7T3OUX/jliKW+XuHV6s3ndUlzaOPgpAePEtouZ50rDTPVp/PJY8ij/ mOtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z+sTJafYM5OEQ9HbdnyG6XAsGqsE9OBqzMuHqiUWL3s=; b=JZEXcbAoichJ039nIdDtsvJetXivODHpq/DLbtoXiPwLVXy8slcWCo8nMy9Uj5N4jy pnA+/eXHSFpPIOmA5n93eeiXgUyl4AeuWoFayX7AlORvy+RtLlZ8jw8Zv3zV3f8QnTFP OenvKCgXiUbN+iHiB6miDfnNW0hzH7rWMlgxZFZf+J1dBHx8xWwQexuAHhgcu+cUXnsq LDa1WD+0UM9PjkznV1sUhhznX5B2meNCKvLi7sokStAPP96h9gB5QsNNDedqbUAyahF3 vBPpYdQVNtXrTU3AoQY5pK4cEuqKGz3dp8RTKH8ECfHw3J+TJdQ70zIJjq4Ke4p5TgG4 +3Tg== X-Gm-Message-State: AG10YORqlry7oshcI77wGUz/1g0RQXobmdbu3Nc1mQ6Og77s7PIC/YSSA4pJo5KzL46A5g== X-Received: by 10.194.103.198 with SMTP id fy6mr11002364wjb.48.1454606970064; Thu, 04 Feb 2016 09:29:30 -0800 (PST) Received: from tn-HP-4.semihalf.local (cardhu.semihalf.com. [213.17.239.108]) by smtp.gmail.com with ESMTPSA id w8sm12238889wjx.21.2016.02.04.09.29.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Feb 2016 09:29:29 -0800 (PST) From: Tomasz Nowicki To: bhelgaas@google.com, arnd@arndb.de, will.deacon@arm.com, catalin.marinas@arm.com, rjw@rjwysocki.net, hanjun.guo@linaro.org, Lorenzo.Pieralisi@arm.com, okaya@codeaurora.org, jiang.liu@linux.intel.com, Stefano.Stabellini@eu.citrix.com Cc: robert.richter@caviumnetworks.com, mw@semihalf.com, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, wangyijing@huawei.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, jchandra@broadcom.com, jcm@redhat.com, Tomasz Nowicki Subject: [PATCH V4 16/23] x86, acpi, pci: Use equivalent function from mcfg.c driver. Date: Thu, 4 Feb 2016 18:28:54 +0100 Message-Id: <1454606941-9523-17-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454606941-9523-1-git-send-email-tn@semihalf.com> References: <1454606941-9523-1-git-send-email-tn@semihalf.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since mcfg.c driver provides the same function lets use it and remove code duplication. Signed-off-by: Tomasz Nowicki Tested-by: Duc Dang Tested-by: Dongdong Liu Tested-by: Hanjun Guo Tested-by: Graeme Gregory Tested-by: Sinan Kaya --- arch/x86/pci/acpi.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index d5086d1..b4e72b5 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -201,29 +201,11 @@ static int setup_mcfg_map(struct acpi_pci_root_info *ci) return 0; } - -static void teardown_mcfg_map(struct acpi_pci_root_info *ci) -{ - struct acpi_pci_root *root = ci->root; - struct pci_mmcfg_region *cfg; - - cfg = pci_mmconfig_lookup(root->segment, root->secondary.start); - if (!cfg) - return; - - if (cfg->hot_added) - pci_mmconfig_delete(root->segment, root->secondary.start, - root->secondary.end); -} #else static int setup_mcfg_map(struct acpi_pci_root_info *ci) { return 0; } - -static void teardown_mcfg_map(struct acpi_pci_root_info *ci) -{ -} #endif static int pci_acpi_root_get_node(struct acpi_pci_root *root) @@ -251,7 +233,7 @@ static int pci_acpi_root_init_info(struct acpi_pci_root_info *ci) static void pci_acpi_root_release_info(struct acpi_pci_root_info *ci) { - teardown_mcfg_map(ci); + pci_mmcfg_teardown_map(ci); kfree(container_of(ci, struct pci_root_info, common)); }