From patchwork Tue Dec 19 05:37:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10122299 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 C101760390 for ; Tue, 19 Dec 2017 05:38:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1A3128D0C for ; Tue, 19 Dec 2017 05:38:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A09DB29041; Tue, 19 Dec 2017 05:38:29 +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=ham 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 1394828D0C for ; Tue, 19 Dec 2017 05:38:28 +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=6KNgaIrol56MVgoC5b7EQf47vvet0GsvU8LkolCgeFs=; b=GAn5IzxVyogxIS+EGs/q1ybTcI 0S7VhdKqIXkMCnYjlc/acNe1O6j16AvwTZtmZh4cBwosHX7+i6tC3MjJpG9NXxzq4KzoO0bBVeyJH R1ckGDEM9ywRrpxvUPaYoLo2SfbQjRuPbUOL/kkp7x3fJ83z5s2M4Uf+T+6qjINd8dfdeGvLkDiBH pRTezjHAxLz0KlEA4P+CL8XhWX8od5WriH4gHPZQD5OxX8W437GPXkpfcHDBVdsKg8EjvJUmb5hvM GE3WZJvKWXv4L6EI3+ZU4K6Qll3Sq1RIRLME+rjMG1Xm67d4jRshaW71BkecjgnIm2FMXKG5TdvCd QsImYRCQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eRAbg-0002qD-RP; Tue, 19 Dec 2017 05:38:24 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eRAbc-0002ov-Ju for linux-arm-kernel@lists.infradead.org; Tue, 19 Dec 2017 05:38:22 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5C0126070B; Tue, 19 Dec 2017 05:38:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1513661899; bh=sL4C8lctC4ee3/ShMQE8QznF5e191mprwH+BT0S8PyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A9IB0/pbsgOnb7MCgaD2jzabbS7T3lzaL+GtzpS8zRXeXVU27vjSQj2GoHw/ayrK3 fvLiB7XzuKkdHir3P4jyDP/tmRIiI5h7s+iv/tif7WLPUI1XkqWUf5WDe5lMK08sK3 iKRtKAxaYAdoW6yoydQQyEWEvBMxZQVRbrZM6AJY= 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 1FB116024A; Tue, 19 Dec 2017 05:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1513661898; bh=sL4C8lctC4ee3/ShMQE8QznF5e191mprwH+BT0S8PyM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X5jMBItEwPE9cM/39a5sJIAD4a2pqqdvPFJUlKqT+tLXJP7Kh+kqEYbhSVcAPo4nY WUg+qI2vd3RKODkT4vb3DhHf2aKFLipPuBVv36hzg8ullm9kWZMr1Ra3jYMK/crGfd JJXRaLdAaLrdiKgrfXuCzvymr/I9SvbdOCELytjQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1FB116024A 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 V4 02/26] powerpc/PCI: deprecate pci_get_bus_and_slot() Date: Tue, 19 Dec 2017 00:37:38 -0500 Message-Id: <1513661883-28662-3-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513661883-28662-1-git-send-email-okaya@codeaurora.org> References: <1513661883-28662-1-git-send-email-okaya@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171218_213820_743779_03A61024 X-CRM114-Status: GOOD ( 12.25 ) 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 Acked-by: Michael Ellerman (powerpc) --- 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 466b842..3f82cb2 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);