[alsa-devel] [PATCH 2/7] ASoC: DAPM: Pass snd_dapm_soc_update as parameter
broonie at opensource.wolfsonmicro.com
Thu Apr 28 22:58:27 CEST 2011
On Thu, Apr 28, 2011 at 10:39:08PM +0200, Lars-Peter Clausen wrote:
> On 04/28/2011 09:40 PM, Mark Brown wrote:
> > If we're going to do something like this it would be better to make the
> > update a more complex object so we weren't passing the stream update
> > separately. The update should be "what we're doing right now" which
> > includes the stream operation. [...]
> Hm... the current update struct only contains information on register updates,
> since we don't not always want to update a register when we sent a stream event
> and vice versa it does make sense to keep them separate.
Sure, but we've already got a perfectly good way of representing no
register which we can use. No big deal there.
> > TBH I'm not sure how much of a help I find this, it's nice to not have
> > to pass the operation we're doing about all the time especially if we
> > end up using more context information in the middle of the operation
> > (which I suspect we may end up doing). You still have to work back
> > through the call chain to find where the data came from.
> Well, but you know that it is a parameter to the function call. With the
> current scheme you don't know this immediately. Right now dapm->update is some
> random global variable and it is not quite clear that it is only valid for the
> time dapm_power_widgets is called.
It should be valid at any time, it's cleared after use. It only makes
sense when something is in the middle of doing an update. Half of the
thing for me is that we can now grep for actual users without seeing
things that are just bouncing the data around.
More information about the Alsa-devel