.\" 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_DRV" "9" "09 October 2005" "" "" .SH NAME bus_for_each_drv \- driver iterator .SH SYNOPSIS "SYNOPSIS" .sp \fB .sp int bus_for_each_drv (struct bus_type * \fIbus\fB, struct device_driver * \fIstart\fB, void * \fIdata\fB, int (*\fIfn\fB) struct device_driver *, void *); \fR .SH "ARGUMENTS" .TP \fB\fIbus\fB\fR bus we're dealing with. .TP \fB\fIstart\fB\fR driver to start iterating on. .TP \fB\fIdata\fB\fR data to pass to the callback. .TP \fB\fIfn\fB\fR function to call for each driver. .SH "DESCRIPTION" .PP This is nearly identical to the device iterator above. We iterate over each driver that belongs to \fIbus\fR, and call \fIfn\fR for each. If \fIfn\fR returns anything but 0, we break out and return it. If \fIstart\fR is not NULL, we use it as the head of the list. .SH "NOTE" .PP we don't return the driver that returns a non-zero value, nor do we leave the reference count incremented for that driver. If the caller needs to know that info, it must set it in the callback. It must also be sure to increment the refcount so it doesn't disappear before returning to the caller.