From patchwork Tue Sep 25 08:26:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 1502991 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 56B5EDF28C for ; Tue, 25 Sep 2012 08:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753924Ab2IYI1A (ORCPT ); Tue, 25 Sep 2012 04:27:00 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:42894 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753764Ab2IYI0w (ORCPT ); Tue, 25 Sep 2012 04:26:52 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q8P8Qh5W020213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Sep 2012 08:26:44 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q8P8QgoH021013 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Sep 2012 08:26:42 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q8P8QfKF007819; Tue, 25 Sep 2012 03:26:41 -0500 Received: from linux-siqj.site (/75.36.245.102) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 25 Sep 2012 01:26:41 -0700 From: Yinghai Lu To: Bjorn Helgaas , Len Brown Cc: linux-pci@vger.kernel.org, Yinghai Lu , David Airlie , dri-devel@lists.freedesktop.org Subject: [PATCH 18/29] PCI, drm: kill pci_root_buses in alpha hose setting Date: Tue, 25 Sep 2012 01:26:19 -0700 Message-Id: <1348561590-28067-19-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1348561590-28067-1-git-send-email-yinghai@kernel.org> References: <1348561590-28067-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Signed-off-by: Yinghai Lu Cc: David Airlie Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_fops.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 5062eec..ff4cdf3 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -340,9 +340,13 @@ static int drm_open_helper(struct inode *inode, struct file *filp, pci_dev_put(pci_dev); } if (!dev->hose) { - struct pci_bus *b = pci_bus_b(pci_root_buses.next); - if (b) - dev->hose = b->sysdata; + struct pci_host_bridge *host_bridge; + + host_bridge = pci_next_host_bridge(NULL); + if (host_bridge) { + dev->hose = host_bridge->bus->sysdata; + put_device(&host_bridge->dev); + } } } #endif