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: 10069801 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 3122D60353 for ; Wed, 22 Nov 2017 05:49:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B011204FB for ; Wed, 22 Nov 2017 05:49:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FA0629B48; Wed, 22 Nov 2017 05:49: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 8EF81204FB for ; Wed, 22 Nov 2017 05:49:23 +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=+3bJQlPZVvztwj00RE/qTy7MHs40AlBk5Qnqw63tm+I=; b=QXWNuQtPlbA5TqfZTJKKaw5D8R bpYgCRskdASTvVj5Lt6rwbZn9yywometALBMjk1xvGWj4B1ZC5kjEoyCr2pCGR8FK3HsWmPJLWLK1 B0YLrfnPtKz5/cgYUlp91V5IJJIxk4t5qAvTfrdMxbqG3MXFL1W3+yPpfZh/DIxZi/tNGbxTGitLc GV/My7q6n0wQF1L9ON1JrAoZlnifL/E8CKVAg3BbuG+zBOsgC/fXvEZrWaWZD/pbVf9bLWFFNY0dJ XtRdqCD2ePgcD3x1KH3oMt6sr/v7zQg2LlbNpBNSVFdSsoGl/xoWr2BU5gQcg4izvWB9tisPSjDls TCZg3l8w==; 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 1eHNuU-0002nH-Ud; Wed, 22 Nov 2017 05:49:23 +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 1eHNuA-0002Ls-QC for linux-arm-kernel@bombadil.infradead.org; Wed, 22 Nov 2017 05:49:03 +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=JHEAAgJpNT7nhXtpBmj7yNbWJaItMg8Olw127C/gv8k=; b=XfR64Ra2enPWxzhBENLL1jewv aAyvenagb5parm/DcmyAxHAZdEf3gsf0qOj08odN2HDZVWw1WxVch9QGlmkTNHOJ9/KksOdYpYWwq OsT14wo3pAsER75W4ielK56ix21Q+6la0CltkEpSgTdUQyBuMoozIHQ4wE04qV+HyIFo+oGE7hrn1 RpSSFQog9kNPxyV8EYRl+TcWjb4R5hzoM9+cTZXb49h1YAUoDdiPwNJ8xwvx70tWzk9e6+lHDUSl0 DQSlG50qI4Xtmmc/q2HQICuKPxdY/KJ45/BK9mZX38hDZas1C7+9iCJYhw20y1tEyYdpGsAHHI1Qo KXgVgmIyg==; Received: from smtp.codeaurora.org ([198.145.29.96]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eHNel-00085E-1X for linux-arm-kernel@lists.infradead.org; Wed, 22 Nov 2017 05:33:09 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3B53360C1B; 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=1511328765; bh=dsE7QDTiGjCWbIk2zk9ao5lSpNaItbzRbtSeP3tqGP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=apbfcltvkTqQx0slpGnuTL8Eo3/eekVHt+PTNNzMYE+myKZC4DtqhWMLXT07nC7iV V4gkzV0tutjZnbesvB4eCegtu9869j6uKE0WMxdDxgNgQgj0A0Q83Sy88U7p8c3OUh swXfKypjv/R2W/m4kNxaxZ9HcnG6G560/spPGBzI= 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171122_053307_358208_DB85F05F X-CRM114-Status: GOOD ( 15.49 ) 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/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;