From patchwork Mon Feb 6 15:22:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9558215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A731B60242 for ; Mon, 6 Feb 2017 15:24:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9725B212E8 for ; Mon, 6 Feb 2017 15:24:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BAE822701; Mon, 6 Feb 2017 15:24:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 24696212E8 for ; Mon, 6 Feb 2017 15:24:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cal94-0003fx-Ck; Mon, 06 Feb 2017 15:23:58 +0000 Received: from mail-pf0-f194.google.com ([209.85.192.194]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cal8z-0003cX-Nq for linux-arm-kernel@lists.infradead.org; Mon, 06 Feb 2017 15:23:55 +0000 Received: by mail-pf0-f194.google.com with SMTP id y143so7107642pfb.1 for ; Mon, 06 Feb 2017 07:23:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cJM3LQwX+q2HHaIHNi8W0WmC0Ai5U55U6DYAL6NGRhQ=; b=FiG3hndXPl8mYqF9WKkOS9zMb0Tip49bDVyByJ5V2xO5gNdEQ6Jiw+p6msJt63naGi MteUKqX1u7vxZ/QEgfuII6emhna3KDvQ0EuedXUsqeEEr3qMKmDeaFQjgEpY3LRMIujy OluK4/LFFBz7gnONuHetMaZkBi6Q0qwW/aO49r/kj2mucoKqYapyMNkpkhE0nnkmTcxX o4MbIzs6E37MQhP1grU6oKnFCuJMknKyL1tLObawjpR+WUoUxA3Otu3TcyBbegvl2jc4 ZwO54jBg73Ol5rXisYWUhIM8LCOYYLCSXjFuIjiZKV6LM7tXAHKft9YwFxX7+Rh3OYeH mhEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cJM3LQwX+q2HHaIHNi8W0WmC0Ai5U55U6DYAL6NGRhQ=; b=Hu0a/bVwsg2Tlljhx/5z/qc8vrrUZFkHE1uf+3ossODTkykgYE7ON0AAI8Ynx0Ev71 Tcf8//5GHMk/unAgbicce35v3uzfPkNPBprm+dksHU+sl6W62pGzKkMlqXNZjVTE5klH vgXKVBS/brDa3d2V6NVqf+IXpkyw1zX8kWO3HYAu1c0G/m+6TNVdl7eAzEa1rR1CN2RL uy6fLfanM7K7+Yd4xNEILEIU4DxEvU84NvbvPDLBmyD6+a9yps55a5unxuI6bcKWI/YC SdOWo7fhph6/QOCXkAQJ6gF59t5815/1c6/IYC2xhfQ7Daqsri+lp7/xmFdAo3PUo6rh GVHQ== X-Gm-Message-State: AIkVDXJ+whA3m1gKL0CvIPM3Bg9IRSWFz9i/Bs5XdLyQXjfDECv/mbcDbWWEDM2Et9sp4A== X-Received: by 10.84.136.7 with SMTP id 7mr18301323plk.100.1486394553293; Mon, 06 Feb 2017 07:22:33 -0800 (PST) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id z74sm3533056pfd.70.2017.02.06.07.22.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Feb 2017 07:22:32 -0800 (PST) From: Wei Yongjun To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Maxime Ripard , Chen-Yu Tsai , Marcus Cooper Subject: [PATCH -next] ASoC: sun4i-spdif: drop unnessary snd_soc_unregister_component() Date: Mon, 6 Feb 2017 15:22:24 +0000 Message-Id: <20170206152224.7566-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170206_072353_837278_EAB5EADC X-CRM114-Status: GOOD ( 11.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Wei Yongjun , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun It's not necessary to unregister a component registered with devm_snd_soc_register_component(). Also removed pointness clk_disable_unprepare() from error path and snd_soc_unregister_platform() from the remove. Fixes: f8260afa444b ("ASoC: sunxi: Add support for the SPDIF block") Signed-off-by: Wei Yongjun Acked-by: Maxime Ripard --- sound/soc/sunxi/sun4i-spdif.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index c03cd07..eaefd07 100644 --- a/sound/soc/sunxi/sun4i-spdif.c +++ b/sound/soc/sunxi/sun4i-spdif.c @@ -510,8 +510,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev) host->spdif_clk = devm_clk_get(&pdev->dev, "spdif"); if (IS_ERR(host->spdif_clk)) { dev_err(&pdev->dev, "failed to get a spdif clock.\n"); - ret = PTR_ERR(host->spdif_clk); - goto err_disable_apb_clk; + return PTR_ERR(host->spdif_clk); } host->dma_params_tx.addr = res->start + quirks->reg_dac_txdata; @@ -525,7 +524,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev) if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) { ret = -EPROBE_DEFER; dev_err(&pdev->dev, "Failed to get reset: %d\n", ret); - goto err_disable_apb_clk; + return ret; } if (!IS_ERR(host->rst)) reset_control_deassert(host->rst); @@ -534,7 +533,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev) ret = devm_snd_soc_register_component(&pdev->dev, &sun4i_spdif_component, &sun4i_spdif_dai, 1); if (ret) - goto err_disable_apb_clk; + return ret; pm_runtime_enable(&pdev->dev); if (!pm_runtime_enabled(&pdev->dev)) { @@ -552,9 +551,6 @@ static int sun4i_spdif_probe(struct platform_device *pdev) sun4i_spdif_runtime_suspend(&pdev->dev); err_unregister: pm_runtime_disable(&pdev->dev); - snd_soc_unregister_component(&pdev->dev); -err_disable_apb_clk: - clk_disable_unprepare(host->apb_clk); return ret; } @@ -564,9 +560,6 @@ static int sun4i_spdif_remove(struct platform_device *pdev) if (!pm_runtime_status_suspended(&pdev->dev)) sun4i_spdif_runtime_suspend(&pdev->dev); - snd_soc_unregister_platform(&pdev->dev); - snd_soc_unregister_component(&pdev->dev); - return 0; }