Skip to content

Commit 59c1ad3

Browse files
YijingWangbjorn-helgaas
authored andcommitted
drm: Use list_for_each_entry() for bus traversal
Replace list_for_each() + pci_bus_b() with list_for_each_entry(). Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent f0197e0 commit 59c1ad3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/gpu/drm/drm_fops.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
319319
pci_dev_put(pci_dev);
320320
}
321321
if (!dev->hose) {
322-
struct pci_bus *b = pci_bus_b(pci_root_buses.next);
322+
struct pci_bus *b = list_entry(pci_root_buses.next,
323+
struct pci_bus, node);
323324
if (b)
324325
dev->hose = b->sysdata;
325326
}

0 commit comments

Comments
 (0)