[PATCH] soundwire: intel: move to auxiliary bus
Greg KH
gregkh at linuxfoundation.org
Tue Mar 23 19:32:57 CET 2021
On Tue, Mar 23, 2021 at 01:04:49PM -0500, Pierre-Louis Bossart wrote:
>
> > > Note that the auxiliary bus API has separate init and add steps, which
> > > requires more attention in the error unwinding paths. The main loop
> > > needs to deal with kfree() and auxiliary_device_uninit() for the
> > > current iteration before jumping to the common label which releases
> > > everything allocated in prior iterations.
> >
> > The init/add steps can be moved together in the aux bus code if that
> > makes this usage simpler. Please do that instead.
>
> IIRC the two steps were separated during the auxbus reviews to allow the
> parent to call kfree() on an init failure, and auxiliary_device_uninit()
> afterwards.
>
> https://www.kernel.org/doc/html/latest/driver-api/auxiliary_bus.html#auxiliary-device
>
> With a single auxbus_register(), the parent wouldn't know whether to use
> kfree() or auxiliary_device_uinit() when an error is returned, would it?
>
It should, you know the difference when you call device_register() vs.
device_initialize()/device_add(), for what to do, right?
Should be no difference here either :)
More information about the Alsa-devel
mailing list