[alsa-devel] [PATCH 3/3] ASoC: ux500: Dynamically fill DAI driver data on probe
Lee Jones
lee.jones at linaro.org
Tue Dec 3 04:59:58 EST 2013
> >>[...]
> >>>+void ux500_msp_populate_dai_drv(struct snd_soc_dai_driver *ux500_msp_dai_drv)
> >>>+{
> >>>+ ux500_msp_dai_drv->probe = ux500_msp_dai_probe;
> >>>+ ux500_msp_dai_drv->suspend = NULL;
> >>>+ ux500_msp_dai_drv->resume = NULL;
> >>>+ ux500_msp_dai_drv->playback.channels_min = UX500_MSP_MIN_CHANNELS;
> >>>+ ux500_msp_dai_drv->playback.channels_max = UX500_MSP_MAX_CHANNELS;
> >>>+ ux500_msp_dai_drv->playback.rates = UX500_I2S_RATES;
> >>>+ ux500_msp_dai_drv->playback.formats = UX500_I2S_FORMATS;
> >>>+ ux500_msp_dai_drv->capture.channels_min = UX500_MSP_MIN_CHANNELS;
> >>>+ ux500_msp_dai_drv->capture.channels_max = UX500_MSP_MAX_CHANNELS;
> >>>+ ux500_msp_dai_drv->capture.rates = UX500_I2S_RATES;
> >>>+ ux500_msp_dai_drv->capture.formats = UX500_I2S_FORMATS;
> >>>+ ux500_msp_dai_drv->ops = ux500_msp_dai_ops;
> >>> };
> >>
> >>You can just use the same static driver for all devices. No need to
> >>dynamically allocate it.
> >
> >How do you mean? Just create a 'static struct' instead?
>
> Yes.
>
> static struct snd_soc_dai_driver ux500_msp_dai_driver = {
> ...
> };
Yes, that's no issue. I was more focused on the reduction of code
than anything else, but that is a better idea.
I'll resubmit.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
More information about the linux-arm-kernel
mailing list