Skip to content

Commit

Permalink
drm: Use list_for_each_entry() for bus traversal
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
YijingWang authored and bjorn-helgaas committed Feb 14, 2014
1 parent f0197e0 commit 59c1ad3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/drm_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ 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);
struct pci_bus *b = list_entry(pci_root_buses.next,
struct pci_bus, node);
if (b)
dev->hose = b->sysdata;
}
Expand Down

0 comments on commit 59c1ad3

Please sign in to comment.