Re: [PATCH v4 14/15] ASoC: rockchip/rockchip-hdmi-audio: add sound driver for hdmi audio

From: Mark Brown
Date: Thu Mar 26 2015 - 21:20:14 EST


On Fri, Mar 27, 2015 at 09:16:17AM +0800, yakir wrote:
> On 2015å03æ27æ 02:16, Mark Brown wrote:

> >>+free_cpu_of_node:
> >>+ hdmi_audio_dai.cpu_of_node = NULL;
> >>+ hdmi_audio_dai.platform_of_node = NULL;
> >>+free_priv_data:
> >>+ snd_soc_card_set_drvdata(card, NULL);
> >>+ platform_set_drvdata(pdev, NULL);
> >>+ card->dev = NULL;

> >If any of these assignments is doing anything there's a problem with the
> >code.


> Yes, when probe failed, program will goto this code.

You're missing the point, these don't do anything useful.

> >>+{
> >>+ struct snd_soc_card *card = platform_get_drvdata(pdev);
> >>+
> >>+ snd_soc_unregister_card(card);

> >devm_snd_soc_register_card() and you can remove this function entirely.

> do you mean that when I take devm_snd_soc_register_card() to register card,
> then I do not need unregister card any more(destroy with device) ?

Yes, that is the whole point of the devm_ APIs.

Attachment: signature.asc
Description: Digital signature