On Mon, Jun 07, 2021 at 09:55:47PM -0300, Jason Gunthorpe wrote: > This is intended as a replacement API for device_bind_driver(). It has at > least the following benefits: > > - Internal locking. Few of the users of device_bind_driver() follow the > locking rules > > - Calls device driver probe() internally. Notably this means that devm > support for probe works correctly as probe() error will call > devres_release_all() > > - struct device_driver -> dev_groups is supported > > - Simplified calling convention, no need to manually call probe(). Btw, it would be nice to convert at least one existing user of device_bind_driver to show this. Also maybe Cc all maintainers of subsystems using device_bind_driver so that they get a headsup and maybe quickly move over? > @@ -1077,6 +1079,7 @@ int device_driver_attach(struct device_driver *drv, struct device *dev) > return -EAGAIN; > return ret; > } > +EXPORT_SYMBOL_GPL(device_driver_attach); Ok, this means my earlier suggestions of a locked driver_probe_device helper needs a different name as we really don't want to expose flags and always return -EAGAIN here. So maybe rename driver_probe_device to __driver_probe_device, have a driver_probe_device around it that does the locking and keep device_driver_attach for the newly exported API. The kerneldoc for device_driver_attach is pretty sparse, it might want a little brushup as well.