From patchwork Wed Nov 22 05:31:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10069797 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 08EF96038F for ; Wed, 22 Nov 2017 05:45:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0338F29B48 for ; Wed, 22 Nov 2017 05:45:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB0FB29B50; Wed, 22 Nov 2017 05:45:30 +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 DD24029B48 for ; Wed, 22 Nov 2017 05:45:29 +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=yHrHza/xK8Hwkg1e8jZDtSxl0GzkFvHuDwRBU1Y8pAo=; b=LPzNZ+OYfWdHBtACgFYg0rVtlY RHNv7R3mNpXOhACUikFDetfvK+q9iEHmoRUk8IRLaIvy7G/aSRPLTZdwM8XF64b01y5Z2yRwx0Ssq HBBl9h74vEzqKlcRxDGd58Iswq7P734N+igrOR3wYmrIZJD+soc2+e3Vd7CcjYCJIyv0hKUKa7mW8 jpVlqU2eOPrhQyLyOlA6gN6ooEI31xJsS6H44HPQ/R4EhQKvDFgO3w6nxquVT6gDNq3MUUC6WoKuk sxLvFFSW7unrXOA7nT23tHHNKMFcGHShJUeEG92BTcXTSQm8abGK6ryg7bXhQWNBhbOZ5H6DWMiL4 2A4VIaTA==; 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 1eHNqi-0000Np-Hr; Wed, 22 Nov 2017 05:45:28 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eHNef-0006VP-S3 for linux-arm-kernel@lists.infradead.org; Wed, 22 Nov 2017 05:33:54 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A6D0A60913; Wed, 22 Nov 2017 05:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511328762; bh=zXKDW19az/fFp4rHnzz6x5T5GnnDOfPLus4CqGkAP0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L7dkHvGD9o+DD/pWHIhLcxKvthITwyQ5oJCT8Mr/Ydu7rDrjkMeyT/2x90a8UWxHR wa6V9QLvs7i13ieZXGbvsCI2wn3wWtKa5kHOnLYpxG6W4NgFea16NqYCHn6iOcNlII noTi5TTkPyZQfOxKj6V6PyuHVhmOPcPuxyweCnuA= 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 C707860BF5; Wed, 22 Nov 2017 05:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511328756; bh=zXKDW19az/fFp4rHnzz6x5T5GnnDOfPLus4CqGkAP0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=both06MDPZW1eXgQmN+LfeOhZewmi3adKqimPa7Ro4AVQeFiri0jxu0vNe8kkVwBm Ib81+EdyOHfyG5c4NFiMJlPCm8apVrwwAeTbHIjN5v+s0OtvxF1JpEJ7T4AUM7yb45 LJtNeE61c+2yaOQyt1Vzw7q7OQ/4yu49JcUoUMJg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C707860BF5 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 27/30] video: fbdev: nvidia: deprecate pci_get_bus_and_slot() Date: Wed, 22 Nov 2017 00:31:12 -0500 Message-Id: <1511328675-21981-28-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1511328675-21981-1-git-send-email-okaya@codeaurora.org> References: <1511328675-21981-1-git-send-email-okaya@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171121_213303_122386_1647FA8B X-CRM114-Status: GOOD ( 10.64 ) 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: "open list:NVIDIA rivafb and nvidiafb FRAMEBUFFER DRIVER" , Antonino Daplas , Bartlomiej Zolnierkiewicz , linux-arm-msm@vger.kernel.org, open list , Sinan Kaya , 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. Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't extract the domain number. Other places, use the actual domain number from the device. Signed-off-by: Sinan Kaya --- drivers/video/fbdev/nvidia/nv_hw.c | 10 +++++----- drivers/video/fbdev/nvidia/nv_setup.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/nvidia/nv_hw.c b/drivers/video/fbdev/nvidia/nv_hw.c index 81c80ac..3374c5d 100644 --- a/drivers/video/fbdev/nvidia/nv_hw.c +++ b/drivers/video/fbdev/nvidia/nv_hw.c @@ -686,7 +686,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk, if ((par->Chipset & 0x0FF0) == 0x01A0) { unsigned int uMClkPostDiv; - dev = pci_get_bus_and_slot(0, 3); + dev = pci_get_domain_bus_and_slot(0, 0, 3); pci_read_config_dword(dev, 0x6C, &uMClkPostDiv); uMClkPostDiv = (uMClkPostDiv >> 8) & 0xf; @@ -694,7 +694,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk, uMClkPostDiv = 4; MClk = 400000 / uMClkPostDiv; } else { - dev = pci_get_bus_and_slot(0, 5); + dev = pci_get_domain_bus_and_slot(0, 0, 5); pci_read_config_dword(dev, 0x4c, &MClk); MClk /= 1000; } @@ -707,13 +707,13 @@ static void nForceUpdateArbitrationSettings(unsigned VClk, sim_data.pix_bpp = (char)pixelDepth; sim_data.enable_video = 0; sim_data.enable_mp = 0; - dev = pci_get_bus_and_slot(0, 1); + dev = pci_get_domain_bus_and_slot(0, 0, 1); pci_read_config_dword(dev, 0x7C, &sim_data.memory_type); pci_dev_put(dev); sim_data.memory_type = (sim_data.memory_type >> 12) & 1; sim_data.memory_width = 64; - dev = pci_get_bus_and_slot(0, 3); + dev = pci_get_domain_bus_and_slot(0, 0, 3); pci_read_config_dword(dev, 0, &memctrl); pci_dev_put(dev); memctrl >>= 16; @@ -721,7 +721,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk, if ((memctrl == 0x1A9) || (memctrl == 0x1AB) || (memctrl == 0x1ED)) { u32 dimm[3]; - dev = pci_get_bus_and_slot(0, 2); + dev = pci_get_domain_bus_and_slot(0, 0, 2); pci_read_config_dword(dev, 0x40, &dimm[0]); dimm[0] = (dimm[0] >> 8) & 0x4f; pci_read_config_dword(dev, 0x44, &dimm[1]); diff --git a/drivers/video/fbdev/nvidia/nv_setup.c b/drivers/video/fbdev/nvidia/nv_setup.c index 2f2e162..79806ff 100644 --- a/drivers/video/fbdev/nvidia/nv_setup.c +++ b/drivers/video/fbdev/nvidia/nv_setup.c @@ -264,7 +264,7 @@ static void nv10GetConfig(struct nvidia_par *par) } #endif - dev = pci_get_bus_and_slot(0, 1); + dev = pci_get_domain_bus_and_slot(0, 0, 1); if ((par->Chipset & 0xffff) == 0x01a0) { u32 amt;