On Fri, 2018-04-13 at 08:11 +0200, Hannes Reinecke wrote: > On Thu, 12 Apr 2018 13:32:07 -0600 > "Bart Van Assche" <bart.vanassche@xxxxxxx> wrote: > > +static int find_child_rport(struct device *dev, void *data) > > +{ > > + struct device **child = data; > > + > > + if (scsi_is_srp_rport(dev)) { > > + WARN_ON_ONCE(*child); > > + *child = dev; > > + } > > + return 0; > > +} > > + > > Why not have 'static struct device *find_child_rport() ? Hello Hannes, The function device_for_each_child() expects to be passed a int (*)(struct device *, void *) pointer. Is there perhaps another function for iterating over device children that accepts a function that returns a pointer? Thanks, Bart.