From patchwork Tue Sep 29 11:29:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 'Qinglang Miao X-Patchwork-Id: 266940 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 BA29DC4727C for ; Thu, 1 Oct 2020 13:44:48 +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 D9F47206FC for ; Thu, 1 Oct 2020 13:44:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="J3/P1AN3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9F47206FC 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 55D3718B2; Thu, 1 Oct 2020 15:43:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 55D3718B2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601559886; bh=nqIdhv0dx6gMQzLQEqVaP3Ld5pXBV2d9WN/jtUiuR34=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=J3/P1AN3hwkMpzcMxsJ7Z/NWu6eyQFubnzantPhT/GwvBIorIYN5YdiJGhRRN00U1 JGesxBNzElrR+Ojm1PxY0Pcy2yH2jTS7edDm2on2th8ChrvDaSz7nMqdrIvXJJrRFq RBO5XnUuTNnaBK+gWAcEHeuhBsjdNkLgLui/1+DI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 881C7F80304; Thu, 1 Oct 2020 15:40:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 91D70F802BD; Tue, 29 Sep 2020 13:30:01 +0200 (CEST) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) (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 6CCECF8022B for ; Tue, 29 Sep 2020 13:29:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6CCECF8022B Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id DDAF11328EEB781063FD; Tue, 29 Sep 2020 19:29:46 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 29 Sep 2020 19:29:38 +0800 From: Qinglang Miao To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , "Thierry Reding" , Jonathan Hunter Subject: [PATCH -next] ASoC: tegra: tegra_rt5640: use devm_snd_soc_register_card() Date: Tue, 29 Sep 2020 19:29:36 +0800 Message-ID: <20200929112936.47441-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_rt5640.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c index d66d86593..c73bd23b3 100644 --- a/sound/soc/tegra/tegra_rt5640.c +++ b/sound/soc/tegra/tegra_rt5640.c @@ -192,7 +192,7 @@ static int tegra_rt5640_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); @@ -202,15 +202,6 @@ static int tegra_rt5640_probe(struct platform_device *pdev) return 0; } -static int tegra_rt5640_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_rt5640_of_match[] = { { .compatible = "nvidia,tegra-audio-rt5640", }, {}, @@ -223,7 +214,6 @@ static struct platform_driver tegra_rt5640_driver = { .of_match_table = tegra_rt5640_of_match, }, .probe = tegra_rt5640_probe, - .remove = tegra_rt5640_remove, }; module_platform_driver(tegra_rt5640_driver);