From: Kuninori Morimoto Subject: [PATCH v2 20/23] ASoC: tegra: tegra20_ac97.c: use devm_snd_soc_register_component() Date: 28 Jun 2019 13:11:04 +0900 Message-ID: <87imsqs662.wl-kuninori.morimoto.gx@renesas.com> References: <87blyitky2.wl-kuninori.morimoto.gx@renesas.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id CCAC4F89779 for ; Fri, 28 Jun 2019 06:11:05 +0200 (CEST) In-Reply-To: <87blyitky2.wl-kuninori.morimoto.gx@renesas.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: Mark Brown Cc: Linux-ALSA List-Id: alsa-devel@alsa-project.org From: Kuninori Morimoto We have devm_xxx version of snd_soc_register_component, let's use it. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/tegra/tegra20_ac97.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index 7c359c4..ae94db4 100644 --- a/sound/soc/tegra/tegra20_ac97.c +++ b/sound/soc/tegra/tegra20_ac97.c @@ -377,8 +377,8 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) goto err_clk_disable_unprepare; } - ret = snd_soc_register_component(&pdev->dev, &tegra20_ac97_component, - &tegra20_ac97_dai, 1); + ret = devm_snd_soc_register_component(&pdev->dev, + &tegra20_ac97_component, &tegra20_ac97_dai, 1); if (ret) { dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); ret = -ENOMEM; @@ -388,7 +388,7 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) ret = tegra_pcm_platform_register(&pdev->dev); if (ret) { dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); - goto err_unregister_component; + goto err_clk_disable_unprepare; } /* XXX: crufty ASoC AC97 API - only one AC97 codec allowed */ @@ -396,8 +396,6 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) return 0; -err_unregister_component: - snd_soc_unregister_component(&pdev->dev); err_clk_disable_unprepare: clk_disable_unprepare(ac97->clk_ac97); err_clk_put: @@ -410,8 +408,6 @@ static int tegra20_ac97_platform_remove(struct platform_device *pdev) { struct tegra20_ac97 *ac97 = dev_get_drvdata(&pdev->dev); - snd_soc_unregister_component(&pdev->dev); - clk_disable_unprepare(ac97->clk_ac97); snd_soc_set_ac97_ops(NULL); -- 2.7.4