[alsa-devel] [PATCH 03/14] ALSA: Add a helper to initialize device

Takashi Iwai tiwai at suse.de
Mon Feb 2 14:53:41 CET 2015


At Mon, 02 Feb 2015 14:43:02 +0100,
Lars-Peter Clausen wrote:
> 
> On 02/02/2015 02:40 PM, Takashi Iwai wrote:
> [...]
> >> And on the long run things
> >> should probably be re-factored to do all memory freeing in a subdevice
> >> specific release function.
> >
> > This patchset is one step toward the simplification, indeed.
> >
> > But, what do you have in mind when you write "a subsystem specific
> > release function"?
> 
> "subdev specific". What you already do for e.g. hwdep and MIDI, but for all 
> of the subdevice types, so the empty default function is no longer needed.
> 
> The kfree(container_of(...)) stuff.

I see.  Yes, the whole device_free stuff should be moved to each
release function ideally.  But as of now, doing it is buggy because of
the lack of kobject dependency chain between card and subsystem
objects.  We'd need to manage the dependency chain among card and
subsystems, not only the refcount of opened subsystem files.

Maybe I'll start working on it with the next patchset once after this
patchset is merged.  Another TODO is to rewrite dev_disconnect and
dev_regsiter call chain with another method, e.g. the standard
notifier chain.  Then we can get rid of snd_device stuff.


Takashi


More information about the Alsa-devel mailing list