---
name: "usb_for_each_dev"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/usb_for_each_dev"
---

# usb\_for\_each\_dev(9)

iterate over all USB devices in the system

## NAME

usb\_for\_each\_dev - iterate over all USB devices in the system

## SYNOPSIS

**int usb\_for\_each\_dev(void \*** *data***, int (\****fn***) (struct usb\_device \*, void \*));**

## ARGUMENTS

*data*

data pointer that will be handed to the callback function

*fn*

callback function to be called for each USB device

## DESCRIPTION

Iterate over all USB devices and call *fn* for each, passing it *data*. If it returns anything other than 0, we break the iteration prematurely and return that value.

## COPYRIGHT
