On 2013/1/28 3:23, Yinghai Lu wrote: > Replace that with hotplug-safe version. > > Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx> > Cc: David Airlie <airlied@xxxxxxxx> > Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx > --- > drivers/gpu/drm/drm_fops.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c > index 133b413..b92a9cc 100644 > --- a/drivers/gpu/drm/drm_fops.c > +++ b/drivers/gpu/drm/drm_fops.c > @@ -356,9 +356,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); pci_get_next_host_bridge() ? > + if (host_bridge) { > + dev->hose = host_bridge->bus->sysdata; > + put_device(&host_bridge->dev); > + } > } > } > #endif > -- Thanks! Yijing _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel