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: 8226361 Return-Path: X-Original-To: patchwork-linux-arm@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 C0AAF9F8AA for ; Thu, 4 Feb 2016 17:36:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D08B62015A for ; Thu, 4 Feb 2016 17:36:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07D3D2039D for ; Thu, 4 Feb 2016 17:36:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRNnX-0003rL-IY; Thu, 04 Feb 2016 17:34:27 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRNj5-0006pf-LF for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2016 17:29:54 +0000 Received: by mail-wm0-x22d.google.com with SMTP id p63so127764491wmp.1 for ; Thu, 04 Feb 2016 09:29:31 -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=YtWekyo67QAjltQoVxo9EXZ6kLfYgmhyU62/YaUYUKicMpk7/6Tn+MtKfURyVgPQQ9 dI3LxXZK8TTIW+/P8cadZK3doHQ8Ei4W688fH2d0UyYPrkiLKVltrwvsjOrr7102gmcJ xUIjNrbDdm7cpwBnJ6CiFy++Gf08MBSfOZ+KrXb+/uqm+VSNLu05j7NxuCGlPwixsiLg 0kQEBT3pemsChpojxIQ4iqRlLubhUcInQrHMrtMihrzriBA8wT77ArvKcveCE/sVNr9S 8tw9Pwq5XeCcIl/+qFtGoM0JKPLUAJzWTmBU9rbUt8FZaGDuUbiIT5TljmIRq8EXasrP XvYg== X-Gm-Message-State: AG10YOS8w7fZfID/pzYPmmQeFbqUEec3fkGeVTZd6WPZhFXCFhuK9eg1/mm+snYaDTyZGA== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160204_092952_049009_309B0BC1 X-CRM114-Status: GOOD ( 10.68 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jchandra@broadcom.com, jcm@redhat.com, linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, Liviu.Dudau@arm.com, ddaney@caviumnetworks.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, robert.richter@caviumnetworks.com, Suravee.Suthikulpanit@amd.com, msalter@redhat.com, wangyijing@huawei.com, Tomasz Nowicki , mw@semihalf.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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)); }