From patchwork Tue Sep 29 11:29:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 'Qinglang Miao X-Patchwork-Id: 267306 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4096BC4727C for ; Thu, 1 Oct 2020 13:44:37 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07B5A207F7 for ; Thu, 1 Oct 2020 13:44:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="tDRLsy2v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07B5A207F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5B3F818AE; Thu, 1 Oct 2020 15:43:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5B3F818AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601559874; bh=AETj0OKKg/0UvPUAPZUQfVk1dXaxwz/ozpMVf/cS/WU=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=tDRLsy2vDpql8d/9lAoIUeOAFa10Lgpne9HQQKe+Tq2O40/ZxdeH3gbuMlApagsTz Bukm+Jry5dzm6jgliXvhMVAVxdR5+INn7geAuoLf3w68u8sU4X5tXiDOCGtcV7BN/+ PSdXxNHp1TsYTTf3/UgIo5F7gM6Sn42Ml7Z57eSE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 105F7F802FD; Thu, 1 Oct 2020 15:40:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 65BA5F80273; Tue, 29 Sep 2020 13:30:01 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 55948F8020C for ; Tue, 29 Sep 2020 13:29:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 55948F8020C Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1D37D95A0F9160BD62D2; Tue, 29 Sep 2020 19:29:50 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Tue, 29 Sep 2020 19:29:39 +0800 From: Qinglang Miao To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , "Thierry Reding" , Jonathan Hunter Subject: [PATCH -next] ASoC: tegra: tegra_wm8753: use devm_snd_soc_register_card() Date: Tue, 29 Sep 2020 19:29:38 +0800 Message-ID: <20200929112938.47599-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 01 Oct 2020 15:40:08 +0200 Cc: linux-tegra@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Qinglang Miao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Using devm_snd_soc_register_card() can make the code shorter and cleaner. Signed-off-by: Qinglang Miao --- sound/soc/tegra/tegra_wm8753.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/sound/soc/tegra/tegra_wm8753.c b/sound/soc/tegra/tegra_wm8753.c index ec3ee0580..fa41fa366 100644 --- a/sound/soc/tegra/tegra_wm8753.c +++ b/sound/soc/tegra/tegra_wm8753.c @@ -155,7 +155,7 @@ static int tegra_wm8753_driver_probe(struct platform_device *pdev) if (ret) return ret; - ret = snd_soc_register_card(card); + ret = devm_snd_soc_register_card(&pdev->dev, card); if (ret) { dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); @@ -165,15 +165,6 @@ static int tegra_wm8753_driver_probe(struct platform_device *pdev) return 0; } -static int tegra_wm8753_driver_remove(struct platform_device *pdev) -{ - struct snd_soc_card *card = platform_get_drvdata(pdev); - - snd_soc_unregister_card(card); - - return 0; -} - static const struct of_device_id tegra_wm8753_of_match[] = { { .compatible = "nvidia,tegra-audio-wm8753", }, {}, @@ -186,7 +177,6 @@ static struct platform_driver tegra_wm8753_driver = { .of_match_table = tegra_wm8753_of_match, }, .probe = tegra_wm8753_driver_probe, - .remove = tegra_wm8753_driver_remove, }; module_platform_driver(tegra_wm8753_driver);