Skip to content

Commit

Permalink
USB: core: hcd-pci: use for_each_pci_dev()
Browse files Browse the repository at this point in the history
Use for_each_pci_dev() to simplify the code.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kulikov Vasiliy authored and Greg Kroah-Hartman committed Aug 10, 2010
1 parent 1e29709 commit 402e8dd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/usb/core/hcd-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ static void companion_common(struct pci_dev *pdev, struct usb_hcd *hcd,
* vice versa.
*/
companion = NULL;
for (;;) {
companion = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, companion);
if (!companion)
break;
for_each_pci_dev(companion) {
if (companion->bus != pdev->bus ||
PCI_SLOT(companion->devfn) != slot)
continue;
Expand Down

0 comments on commit 402e8dd

Please sign in to comment.