From patchwork Mon Nov 27 16:57:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10077603 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 44DC46028E for ; Mon, 27 Nov 2017 17:11:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CBA528E91 for ; Mon, 27 Nov 2017 17:11:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2191F28E96; Mon, 27 Nov 2017 17:11:09 +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 BFEE428E9E for ; Mon, 27 Nov 2017 17:11:08 +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=AjOulUg0wtivI6WXqvmots/OjJ 1Mlt1024Ab/pVGeIhIDHglPYoOf1lN6wN3gkxhdaj+JpXReM/ajJMkf+nFh9WnBmdEEKSILLtYtp+ o9onHdd/RAM6bRDvMTCQC3PsBjlRSlLgEHRnKxfy7RS1gCAxZxGXRViWEdvaV6DR/pHKCSRcJicqz lZ+dvjMnD/Q+dHANNUkYgX8+BrTO/IseBIYWGp5UssPavHeilFh0104fEz62P3a1yfjXQrOan4lA5 eT4VLmATBlPkRwkhFosLpk2W1AfImcjLTvZ6ehE2PMq8usCs9uM2Bpp894Ju36qjSpGD8+A6U7p0m uigq78UA==; 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 1eJMw0-0001TW-3G; Mon, 27 Nov 2017 17:11:08 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eJMuu-00076j-3g for linux-arm-kernel@bombadil.infradead.org; Mon, 27 Nov 2017 17:10:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ceYMQ2uHaVcZDLWhbplodOObz3LSGLYF9Nh6aN/wUns=; b=GDw1vwXlb4rk6etkBQ8O1lE1j O/cqqMa+yQvyF0RDuFdxXaV8yprn5IB4k5XpBvm1JISL2bTFmJMflxOTPmkHdkNiVqKPRqXmUt9v7 5iyL1qnD/090ECWC1ZUmqMS2E/U9XFvxy02zpTZEQsB8fGx+3m/Y9+sfx1f/HRZKe8ijmO877nvKX m/nuplx1tu26jFnJvU8KmTaOzcAs+70C0HcBI1VBguGlh6FpDQeEvTkKipX9CM0J32mv7b6MYIBkM XeSN9m0Hl9o5XFteMneNfh67lXA6q63ULlSd98zlRkfwr3wwXEdvQECVoMIVcFigzkWVaId/SOTB7 OUYC3HPSA==; Received: from smtp.codeaurora.org ([198.145.29.96]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eJMk6-0003nh-1N for linux-arm-kernel@lists.infradead.org; Mon, 27 Nov 2017 16:58:55 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8DCAE6A515; Mon, 27 Nov 2017 16:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511801908; bh=GD7a2Whsyvp2umcc6ITa+LH0qRhS2czd2NDMP9pRWXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hGBcymeojUi6t4OOt8b1zhABoQkBo5+htk2vPUFfH7HwBrKGM8s76hBAImPBLVJdd 5T0ormsr/sLMSMbuIz+Uf3/CKwai8p2DNSDJUV0WkCiKmmTXi5OCUJTdhOHv3ZY05Z ZhqDmpamDcGAxnHMxXrv4BsLUnFoRUbSIGap53kc= 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 C23296A500; Mon, 27 Nov 2017 16:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511801907; bh=GD7a2Whsyvp2umcc6ITa+LH0qRhS2czd2NDMP9pRWXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wxl1y08LS0Qc+X2M35Qb7Jl2rHKl5i+oYFxNaEqmhqO4tkZ7mQ491Wuax2ZENn7FK eWl7JvHMj17cEleG5qKYPMYFunQYhkGc2XV8WeSMoaTkfw3Jjc1+so/GA0UjNtAHoI HPubvO2R9J6n+jy4slIsTq9zDrTwVXPZM/c0FBas= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C23296A500 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 V3 02/29] powerpc/PCI: deprecate pci_get_bus_and_slot() Date: Mon, 27 Nov 2017 11:57:39 -0500 Message-Id: <1511801886-6753-3-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1511801886-6753-1-git-send-email-okaya@codeaurora.org> References: <1511801886-6753-1-git-send-email-okaya@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171127_165850_396736_2476EA2E X-CRM114-Status: GOOD ( 16.78 ) 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 , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, open list , Sinan Kaya , Bhumika Goyal , Paul Mackerras , Michael Ellerman , Benjamin Herrenschmidt , "open list:LINUX FOR POWERPC 32-BIT AND 64-BIT" , linux-arm-kernel@lists.infradead.org, Tyrel Datwyler 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);