22 Aug
2011
22 Aug
'11
1:34 p.m.
On Friday 19 August 2011 10:49:08 Lars-Peter Clausen wrote:
sorry: struct omap_mcpdm *mcpdm = snd_soc_platform_get_drvdata(w->platform);
This would avoid having to add the private_data field to the widget struct. In it's current form it will only really work, if there is just one instance of the driver using the widget. And if that's the case you can use a global variable directly anyway.
The other option was to use global variable to get the *mcpdm for the widget. Generally I try to avoid global variables as much as I can, since the use of them looks really hackish. There could be some way to reach the CPU dai via pointers/lookups from the widget, but it does looked really ugly, and I was only half way there.
--
Péter