From patchwork Wed Nov 22 05:31:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10069629 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 062CD6038F for ; Wed, 22 Nov 2017 05:34:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01FEA29B45 for ; Wed, 22 Nov 2017 05:34:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAD5429B51; Wed, 22 Nov 2017 05:34:03 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A47729B50 for ; Wed, 22 Nov 2017 05:34:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751946AbdKVFcn (ORCPT ); Wed, 22 Nov 2017 00:32:43 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:41916 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751936AbdKVFcl (ORCPT ); Wed, 22 Nov 2017 00:32:41 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7B96060C61; Wed, 22 Nov 2017 05:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1511328760; bh=dsE7QDTiGjCWbIk2zk9ao5lSpNaItbzRbtSeP3tqGP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LlZY7zQmv02WuOrMpjF7Oui3mwh5qPNnGN4wNaMv75JQ9ULBURDA2FT1a7s7oaCaJ Z6CjqHK3IFcke9Jclwq1ldrWy3xTcH7zOuugpOZY8hvYgT4u5QvsJun/l29mpCvhAj 406PvUvgNQO50ZnCgDwfYXAraULo7a9nyADfql/4= 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 3CC9C60C80; 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=1511328758; bh=dsE7QDTiGjCWbIk2zk9ao5lSpNaItbzRbtSeP3tqGP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dg1CfqkRXGOdOI59mB5X3TS15IMLacfgt+WgJk0Rv09AybA/vhZkXJ56t3o3fm+jy w3xC38pLU8M0ygLKD7+zp6WyCNV2oT6hnm9K1fimiOOMT3PnyeMHB6mLW+KlXazw1i 4KvdmzgkAMf1G/oaQS0hAhrwrGQQXjtYZxhMM1vc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3CC9C60C80 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 Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Antonino Daplas , Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org (open list:NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 28/30] video: fbdev: riva: deprecate pci_get_bus_and_slot() Date: Wed, 22 Nov 2017 00:31:13 -0500 Message-Id: <1511328675-21981-29-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> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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/riva/nv_driver.c | 4 ++-- drivers/video/fbdev/riva/riva_hw.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/riva/nv_driver.c b/drivers/video/fbdev/riva/nv_driver.c index f3694cf..d31f51b 100644 --- a/drivers/video/fbdev/riva/nv_driver.c +++ b/drivers/video/fbdev/riva/nv_driver.c @@ -226,12 +226,12 @@ unsigned long riva_get_memlen(struct riva_par *par) case NV_ARCH_30: if(chipset == NV_CHIP_IGEFORCE2) { - dev = pci_get_bus_and_slot(0, 1); + dev = pci_get_domain_bus_and_slot(0, 0, 1); pci_read_config_dword(dev, 0x7C, &amt); pci_dev_put(dev); memlen = (((amt >> 6) & 31) + 1) * 1024; } else if (chipset == NV_CHIP_0x01F0) { - dev = pci_get_bus_and_slot(0, 1); + dev = pci_get_domain_bus_and_slot(0, 0, 1); pci_read_config_dword(dev, 0x84, &amt); pci_dev_put(dev); memlen = (((amt >> 4) & 127) + 1) * 1024; diff --git a/drivers/video/fbdev/riva/riva_hw.c b/drivers/video/fbdev/riva/riva_hw.c index 8bdf37f..29956df 100644 --- a/drivers/video/fbdev/riva/riva_hw.c +++ b/drivers/video/fbdev/riva/riva_hw.c @@ -1117,7 +1117,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar unsigned int uMClkPostDiv; struct pci_dev *dev; - 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); pci_dev_put(dev); uMClkPostDiv = (uMClkPostDiv >> 8) & 0xf; @@ -1132,7 +1132,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar 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; @@ -2118,12 +2118,12 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar * Fill in chip configuration. */ if(chipset == NV_CHIP_IGEFORCE2) { - dev = pci_get_bus_and_slot(0, 1); + dev = pci_get_domain_bus_and_slot(0, 0, 1); pci_read_config_dword(dev, 0x7C, &amt); pci_dev_put(dev); chip->RamAmountKBytes = (((amt >> 6) & 31) + 1) * 1024; } else if(chipset == NV_CHIP_0x01F0) { - dev = pci_get_bus_and_slot(0, 1); + dev = pci_get_domain_bus_and_slot(0, 0, 1); pci_read_config_dword(dev, 0x84, &amt); pci_dev_put(dev); chip->RamAmountKBytes = (((amt >> 4) & 127) + 1) * 1024;