lkml.org 
[lkml]   [2013]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v3, part2 14/20] PCI, DRM: use hotplug-safe iterators to walk PCI buses
    Date
    Enhance DRM drvier to use hotplug-safe iterators to walk PCI buses.

    Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
    Cc: David Airlie <airlied@linux.ie>
    Cc: dri-devel@lists.freedesktop.org
    Cc: linux-kernel@vger.kernel.org
    ---
    drivers/gpu/drm/drm_fops.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
    index 429e07d..dc8c40b 100644
    --- a/drivers/gpu/drm/drm_fops.c
    +++ b/drivers/gpu/drm/drm_fops.c
    @@ -359,9 +359,11 @@ 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)
    + struct pci_bus *b = pci_get_next_root_bus(NULL);
    + if (b) {
    dev->hose = b->sysdata;
    + pci_bus_put(b);
    + }
    }
    }
    #endif
    --
    1.8.1.2


    \
     
     \ /
      Last update: 2013-05-26 18:41    [W:2.574 / U:0.148 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site