Re: [alsa-devel] [PATCH 3/3] ASoC: ux500: Dynamically fill DAIdriver data on probe

From: Lee Jones
Date: Tue Dec 03 2013 - 05:00:19 EST


> >>[...]
> >>>+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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/