On Tue, Apr 19, 2011 at 12:46:16PM -0600, Stephen Warren wrote:
Without this, if tegra_wm8903 is modified to provide controls, widgets, and routes through data rather than calling registration functions, tegra_wm8903_event_* will crash, because w->codec==NULL.
This will break other things as it means that we can't route to the DAPM widgets that are added from machine init functions (eg, those that set up jacks) which is a more common case - see the changelog for the code you're modifying.
There's also the fact that these widgets should be being created in the card DAPM context so I'm a bit concerned that they're getting a CODEC at all. The dereferencing you're trying to do isn't good, you're looking for a CODEC to find the card for widgets in the card DAPM context which shouldn't be associated with any particular CODEC in the first place. You should just find the card based on the DAPM context you're in.