.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "BUS_FOR_EACH_DEV" "9" "09 October 2005" "" ""
.SH NAME
bus_for_each_dev \- device iterator.
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
int bus_for_each_dev (struct bus_type * \fIbus\fB, struct device * \fIstart\fB, void * \fIdata\fB, int (*\fIfn\fB)
struct device *, void *);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIbus\fB\fR
bus type.
.TP
\fB\fIstart\fB\fR
device to start iterating from.
.TP
\fB\fIdata\fB\fR
data for the callback.
.TP
\fB\fIfn\fB\fR
function to be called for each device.
.SH "DESCRIPTION"
.PP
Iterate over \fIbus\fR\&'s list of devices, and call \fIfn\fR for each,
passing it \fIdata\fR\&. If \fIstart\fR is not NULL, we use that device to
begin iterating from.
.PP
We check the return of \fIfn\fR each time. If it returns anything
other than 0, we break out and return that value.
.SH "NOTE"
.PP
The device that returns a non-zero value is not retained
in any way, nor is its refcount incremented. If the caller needs
to retain this data, it should do, and increment the reference
count in the supplied callback.