Commit 402e8dd6 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Greg Kroah-Hartman

USB: core: hcd-pci: use for_each_pci_dev()

Use for_each_pci_dev() to simplify the code.
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1e29709e
...@@ -66,10 +66,7 @@ static void companion_common(struct pci_dev *pdev, struct usb_hcd *hcd, ...@@ -66,10 +66,7 @@ static void companion_common(struct pci_dev *pdev, struct usb_hcd *hcd,
* vice versa. * vice versa.
*/ */
companion = NULL; companion = NULL;
for (;;) { for_each_pci_dev(companion) {
companion = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, companion);
if (!companion)
break;
if (companion->bus != pdev->bus || if (companion->bus != pdev->bus ||
PCI_SLOT(companion->devfn) != slot) PCI_SLOT(companion->devfn) != slot)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment