[alsa-devel] [PATCH 10/17] ALSA: line6: Reorganize card resource handling

Takashi Iwai tiwai at suse.de
Tue Jan 20 08:11:47 CET 2015


At Tue, 20 Jan 2015 00:14:08 -0600,
Chris Rorvick wrote:
> 
> On Mon, Jan 19, 2015 at 9:54 AM, Takashi Iwai <tiwai at suse.de> wrote:
> > This is a fairly big rewrite regarding the card resource management in
> > line6 drivers:
> >
> > - The card creation is moved into line6_probe().  This adds the global
> >   destructor to private_free, so that each driver doesn't have to call
> >   it any longer.
> >
> > - The USB disconnect callback handles the card release, thus each
> >   driver needs to concentrate on only its own resources.  No need to
> >   snd_card_*() call in the destructor.
> >
> > - Fix the potential stall in disconnection by removing
> >   snd_card_free().   It's replaced with snd_card_free_when_closed()
> >   for asynchronous release.
> >
> > - The only remaining operation for the card in each driver is the call
> >   of snd_card_register().  All the rest are dealt in the common module
> >   by itself.
> >
> > - These ended up with removal of audio.[ch] as a result of a reduction
> >   of one layer.  Each driver just needs to call line6_probe().
> 
> Nice looking diff --stat.  :-)
> 
> Seems like this could be nicely split up into a few patches to make it
> a bit easier to review.  I'd be happy to take a stab at that if you
> thought it was worth it.  Otherwise, looks good to me.

It's not trivial to split, unfortunately, because all the above are
related tightly together and the code has been already split to
individual drivers.

Despite the code reduction, what the patch is doing is fairly
straightforward if you know of the standard snd_card creation and
destruction procedure.


Takashi


More information about the Alsa-devel mailing list