Patchwork [18/29] PCI, drm: kill pci_root_buses in alpha hose setting

login
register
mail settings
Submitter Yinghai Lu
Date Sept. 25, 2012, 8:26 a.m.
Message ID <1348561590-28067-19-git-send-email-yinghai@kernel.org>
Download mbox | patch
Permalink /patch/186732/
State Changes Requested
Headers show

Comments

Yinghai Lu - Sept. 25, 2012, 8:26 a.m.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/drm_fops.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

Patch

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