lkml.org 
[lkml]   [2015]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] ASoC: rockchip: Add machine driver for max98090 codec
On Sat, Jul 18, 2015 at 01:08:43PM +0800, Xing Zheng wrote:

> + ret = devm_snd_soc_register_card(&pdev->dev, card);
> + if (ret) {
> + dev_err(&pdev->dev,
> + "Soc register card failed %d\n", ret);
> + return ret;
> + }
> +
> + return ret;
> +}
> +
> +static int snd_rk_mc_remove(struct platform_device *pdev)
> +{
> + struct snd_soc_card *soc_card = platform_get_drvdata(pdev);
> +
> + snd_soc_unregister_card(soc_card);

The point with using devm_snd_soc_register_card() is that you don't need
to manually unregister the card - devm_ ensures that the card is freed.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2015-07-18 11:41    [W:0.054 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site