[alsa-devel] [PATCH 5/6] ASoC: OMAP4: Add HDMI Audio machine driver for OMAP4 boards

Mark Brown broonie at opensource.wolfsonmicro.com
Thu May 5 10:25:17 CEST 2011


On Thu, May 05, 2011 at 02:21:52AM -0500, Ricardo Neri wrote:

> +static struct snd_soc_dai_link omap4_hdmi_dai = {
> +		.name = "HDMI",
> +		.stream_name = "HDMI",

Indentation.

> +static __devinit int omap4_hdmi_probe(struct platform_device *pdev)
> +{
> +	struct snd_soc_card *card = &snd_soc_omap4_hdmi;
> +	int ret;
> +
> +	if (!cpu_is_omap44xx()) {
> +		dev_err(&pdev->dev, "Not running on OMAP4!\n");
> +		return -ENODEV;
> +	}

Why check this?  If the system can't support the DAIs they won't
register so it's redundant and it means more work for OMAP5.

> +	card->dev = &pdev->dev;
> +	platform_set_drvdata(pdev, card);

The set_drvdata() isn't needed.

> +	snd_soc_unregister_card(card);
> +	platform_set_drvdata(pdev, NULL);

You never need to reset driver data on unregister, nothing should
reference it except a driver.

> +MODULE_AUTHOR("Ricardo Neri <ricardo.neri at ti.com>");
> +MODULE_DESCRIPTION("OMAP4 HDMI machine ASoC driver");
> +MODULE_LICENSE("GPL");

MODULE_ALIAS().


More information about the Alsa-devel mailing list