[alsa-devel] [PATCH 1/2] ASoC: WM8962: Create default platform data structure

Nicolin Chen b42378 at freescale.com
Thu Jun 6 05:21:26 CEST 2013


On Wed, Jun 05, 2013 at 01:25:11PM +0100, Mark Brown wrote:
> On Wed, Jun 05, 2013 at 08:12:55PM +0800, Nicolin Chen wrote:
> 
> >  struct wm8962_priv {
> > +	struct wm8962_pdata *pdata;
> 
> More idiomatic style for this is to just embed a copy of the platform
> data struct in the private data then copy any driver model platform data
> on top of it.  This simplifies usage as now the driver can assume that
> there is platform data available at all times.

Hmm..sorry I don't fully get it. Does that mean I should do something like:
struct wm8962_priv {
	struct wm8962_pdata pdata;

instead of pointer? so no devm_kzalloc() for it any more?




More information about the Alsa-devel mailing list