Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3611236pxm; Tue, 1 Mar 2022 01:41:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxB9unRi36k7UKguMYP7Gx08G8sYI0q/xod9qURftGVJPx/uO0FLSW6es7RjMrZxt5EcY+Z X-Received: by 2002:a17:903:40ce:b0:151:7343:9981 with SMTP id t14-20020a17090340ce00b0015173439981mr5633963pld.102.1646127700481; Tue, 01 Mar 2022 01:41:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646127700; cv=none; d=google.com; s=arc-20160816; b=lX0VJywDnaHqEphcm4ZElzTyyZQpUQJ/UTItVrDEh5TOnKMAhIOhL2u4MlW7neGIrC yBWWXe2hAlKVoKVKVFLRkYiihM+QZdu9ETCxhjhxri57C9Qxg4AxuElAzXP1qbYPRHHF T7pSR7z5ecpr32v4qjqNXqjCyIufF51pJPJJfdri/LQCuo//7Ln8QqcmbtGxmUGACPhF A8Pu8NrWHbeG20tawtVXzQ0z7G9IT7bK3lJk4OPL/UpRqyErXAAZdNHCnVkggTOjtKQ1 c/on5sShtJoWm77lO3cCEm5IIIU9clSWd5JlpQX7zxCOjPj5pWBaM8mrr0Cr43aFR6kk 5oag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Z0B0trXVTVXZ76NXgZ57XYeRklAZsETMVLXNgTcx4zk=; b=D2+lc4qTP2Inwm2/48mpTOnzsK3p7Jqr3nCNgm553kvQcYe5x51xcnv506EStBoyIq qJ5BEbZ0Ytso71kgsM/+NLnVtPUz9XtcKYueryet1hsYViOlNs5Km9+pUU2UEB4W1R6+ i5VMHUtPT+alZ0QRfi5jBASg2T+/L685uEIJ9Jv53FbOf9/LtgT1Nh/yPsm6PJZuVZFP Nf3nplYBbimgjV1dscKlHBOXwfWHAYZLlB6fIdNUorBzo0cUSNBOidaiD1us035QSHKv A+QXKxNBQAjCgJXYwFEQvpnv8i5LchcPe0KWA47pU2IkBO00CHjscgN5fF+eoQ51aZQY BQqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a1709027ec200b0014f02e54ce9si12208804plb.574.2022.03.01.01.41.20; Tue, 01 Mar 2022 01:41:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232932AbiCAJHc (ORCPT + 99 others); Tue, 1 Mar 2022 04:07:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbiCAJHa (ORCPT ); Tue, 1 Mar 2022 04:07:30 -0500 Received: from cstnet.cn (smtp21.cstnet.cn [159.226.251.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C5CFA88B1F for ; Tue, 1 Mar 2022 01:06:49 -0800 (PST) Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-01 (Coremail) with SMTP id qwCowAC3V8Ue4h1iFBzxAQ--.26163S2; Tue, 01 Mar 2022 17:06:38 +0800 (CST) From: Jiasheng Jiang To: codrin.ciubotariu@microchip.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@microchip.com Cc: alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] ASoC: atmel_ssc_dai: Handle errors for clk_enable Date: Tue, 1 Mar 2022 17:06:37 +0800 Message-Id: <20220301090637.3776558-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: qwCowAC3V8Ue4h1iFBzxAQ--.26163S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Xr47trWfJF4UZr4UZw4xZwb_yoWDGFg_Wa n7Ww1DXrW5CrWFy3WDur45ArWj9ry7ZrW3tw18tF15tFWUAF1akrW5Janxur17ur4ava4f GrnFqryfAFW7WjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbVAFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxa n2IY04v7MxkIecxEwVAFwVW8uwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJV W8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF 1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6x IIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF 0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxh VjvjDU0xZFpf9x0JUhNVgUUUUU= X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As the potential failure of the clk_enable(), it should be better to check it and return error if fals. Fixes: cbaadf0f90d6 ("ASoC: atmel_ssc_dai: refactor the startup and shutdown") Signed-off-by: Jiasheng Jiang --- sound/soc/atmel/atmel_ssc_dai.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 26e2bc690d86..c1dea8d62416 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -280,7 +280,10 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream, /* Enable PMC peripheral clock for this SSC */ pr_debug("atmel_ssc_dai: Starting clock\n"); - clk_enable(ssc_p->ssc->clk); + ret = clk_enable(ssc_p->ssc->clk); + if (ret) + return ret; + ssc_p->mck_rate = clk_get_rate(ssc_p->ssc->clk); /* Reset the SSC unless initialized to keep it in a clean state */ -- 2.25.1