---
name: "device_for_each_child"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/device_for_each_child"
---

# device\_for\_each\_child(9)

device child iterator.

## NAME

device\_for\_each\_child - device child iterator.

## SYNOPSIS

**int device\_for\_each\_child(struct device \*** *parent***, void \*** *data***, int (\****fn***) (struct device \*dev, void \*data));**

## ARGUMENTS

*parent*

parent struct device.

*data*

data for the callback.

*fn*

function to be called for each device.

## DESCRIPTION

Iterate over *parent*'s child devices, and call *fn* for each, passing it *data*.

We check the return of *fn* each time. If it returns anything other than 0, we break out and return that value.

## COPYRIGHT
