From patchwork Wed Nov 22 22:48:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10071827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 13A1A60353 for ; Wed, 22 Nov 2017 23:00:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04B6C29E50 for ; Wed, 22 Nov 2017 23:00:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED8BF29E5C; Wed, 22 Nov 2017 23:00:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 61E3929E52 for ; Wed, 22 Nov 2017 23:00:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=tjkAf9Iqh0iyihceQ5nqvsvDC4CBIpAww/cuD9XI7Bc=; b=qPSqlH+Uy+xkWWYAWdRD+0F8De aCQ/vXoXjPgoFaqwI9D03wwQTBNi/7Gi7MH5Nt3dYe7gN8yCC3FjtUeN0uHYN+0V/b1Z4TnSzBREw Uo5bmnpex7MvxRGNqfz49SpdM+LTamzfy3x1uztEIZJY4hjuBBsjEXPlwUWXBTuoGILTB9PqF4sV2 EYGJMJtp+VX5JU0KpIXzYwAXPTYQQueFDJmNeAL61mP30ZcPj1xNp3SEVSVy4TG1cjsk7Ld2jm86w RFQPbeis7My5LzqVD0YveF+2XYfIh7T6fsOEwUWvFK2Xn7ilwy5w00TjmVVVyxsMSRg3F9HWvBrBf 3QpsVxcw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eHe0E-0006xU-Pw; Wed, 22 Nov 2017 23:00:22 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eHdq8-0004uZ-OY for linux-arm-kernel@lists.infradead.org; Wed, 22 Nov 2017 22:49:59 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 44BCE60850; Wed, 22 Nov 2017 22:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511390979; bh=GD7a2Whsyvp2umcc6ITa+LH0qRhS2czd2NDMP9pRWXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PLb824QwcHT8Rfcbhn6xrVC4wEE2j2s9PVOibCzLPmQuMtkV9BK2smccH4XyxYCNS XNXejGRHcO2qZl1ZLV0wJ0Bzrw/vlWV/24FqSZypivLKThd2BQ8JpLJNaIza7Mqkbv TP1d4s+vTMNeZvhp2oARh00RKIDHqjmxd6X3k4A8= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id CC8DA6081F; Wed, 22 Nov 2017 22:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511390978; bh=GD7a2Whsyvp2umcc6ITa+LH0qRhS2czd2NDMP9pRWXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bBX4W6CBbLnTiXvd7v6BepRatjoMYMsm6w1u/raj5IHIa1avH3pHOt9kYxjHFeajK uS3JQ0iObWcdos2VYukxctHOM/VrYuks3XItBZP6AIqrNhWtRT5rj31C0y1cYwusVm oi05DWg+K9KfSk77+CsolNtk84HNO2+5SovY8jFw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org CC8DA6081F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-pci@vger.kernel.org, timur@codeaurora.org Subject: [PATCH V2 02/29] powerpc/PCI: deprecate pci_get_bus_and_slot() Date: Wed, 22 Nov 2017 17:48:57 -0500 Message-Id: <1511390964-9979-3-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1511390964-9979-1-git-send-email-okaya@codeaurora.org> References: <1511390964-9979-1-git-send-email-okaya@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171122_144957_201304_2D77B924 X-CRM114-Status: GOOD ( 12.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Benjamin Herrenschmidt , linux-arm-msm@vger.kernel.org, open list , Sinan Kaya , Bhumika Goyal , Paul Mackerras , Tyrel Datwyler , Michael Ellerman , "open list:LINUX FOR POWERPC 32-BIT AND 64-BIT" , 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-Virus-Scanned: ClamAV using ClamSMTP pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as where a PCI device is present. This restricts the device drivers to be reused for other domain numbers. Getting ready to remove pci_get_bus_and_slot() function in favor of pci_get_domain_bus_and_slot(). Use pci_get_domain_bus_and_slot() with a domain number of 0 as the code is not ready to consume multiple domains and existing code used domain number 0. Signed-off-by: Sinan Kaya --- arch/powerpc/kernel/pci_32.c | 3 ++- arch/powerpc/platforms/powermac/feature.c | 2 +- arch/powerpc/sysdev/mv64x60_pci.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 1d817f4..85ad2f7 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c @@ -96,7 +96,8 @@ reg = of_get_property(node, "reg", NULL); if (!reg) continue; - dev = pci_get_bus_and_slot(pci_bus, ((reg[0] >> 8) & 0xff)); + dev = pci_get_domain_bus_and_slot(0, pci_bus, + ((reg[0] >> 8) & 0xff)); if (!dev || !dev->subordinate) { pci_dev_put(dev); continue; diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index 9e3f39d..ed8b166 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c @@ -829,7 +829,7 @@ static long core99_scc_enable(struct device_node *node, long param, long value) if (value) { if (pci_device_from_OF_node(node, &pbus, &pid) == 0) - pdev = pci_get_bus_and_slot(pbus, pid); + pdev = pci_get_domain_bus_and_slot(0, pbus, pid); if (pdev == NULL) return 0; rc = pci_enable_device(pdev); diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c index d52b3b8..6fe9104 100644 --- a/arch/powerpc/sysdev/mv64x60_pci.c +++ b/arch/powerpc/sysdev/mv64x60_pci.c @@ -37,7 +37,7 @@ static ssize_t mv64x60_hs_reg_read(struct file *filp, struct kobject *kobj, if (count < MV64X60_VAL_LEN_MAX) return -EINVAL; - phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); + phb = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0)); if (!phb) return -ENODEV; pci_read_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, &v); @@ -61,7 +61,7 @@ static ssize_t mv64x60_hs_reg_write(struct file *filp, struct kobject *kobj, if (sscanf(buf, "%i", &v) != 1) return -EINVAL; - phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); + phb = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0)); if (!phb) return -ENODEV; pci_write_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, v);