Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2474932pxm; Sun, 27 Feb 2022 22:54:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9scWkzU2GbDGg7wIs5TIMguC4izzCSPUFum3G6Lv5fsYiUwNObdNtl0Kqj38Ca0TjVYGR X-Received: by 2002:a63:2fc1:0:b0:374:9f30:9559 with SMTP id v184-20020a632fc1000000b003749f309559mr16080216pgv.278.1646031271227; Sun, 27 Feb 2022 22:54:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646031271; cv=none; d=google.com; s=arc-20160816; b=VWboX/PVObhnJRHYRz0Jew1dMXQLE6xsJJXOzJFYQW/Toc8MxbZQgwTBLEUPEyTSdy gcSGShxQes6EzPsxP90TT8w0ClCnTm0zbAXW4AMh2wfsXFPucdWp2Wwvmsd4s2yvhuAm tU41OM3+96LCSR9ccJueNYqvJvsV3mb9uIZmFKoh/04qsxlpulvk5B5toRlDw4D7vxGe eyUJ4bJi+afQjE2WuaInPrSg5wkIs2Q0ue9XtjfTsJ+Ha7qemHunfL1eqD9dVG+tQNCl bxvY4IoR1IWqWS9eBvkKcJ0At3z6GIuiJ00h9SB1cLp3YwehyynAw/UholBOu8x32QQE nZYA== 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=SDDksKLyfFp/bGmOJpBi8umrju6P0KDg9kdn0EJVrwk=; b=TikG+knkOTTb6OAMyRpx+BeJAwysi2zqdrbR+sfREeWdtQrPaU1LcfZxQiXvNMK+rA tMapuBBoIgw2l+7eqkQEsNT28q+oMVYc5jrCqoLzb9iEK3EyrWM3C+MDkXn/uUvIcF+Q mdmQJFa2J4OR8beVxurZKL+h73erbhM2Y50umdFQUAiO0XCTXDNKTla02JXQaS0upfSW ssKHu/he4RexYzvV4F/WL5S9xr5rZTZgir0wWHDiUr+D79komTVp30DFGatKsA58t95k bwKqbr3GeL9oemUOx12ZxG8AruAjMsN5b+6er/sE9wGOZTH449sIGxg/cJ1gWJHVUCqJ GEPQ== 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 5-20020a630905000000b00374388c5454si8645192pgj.591.2022.02.27.22.54.15; Sun, 27 Feb 2022 22:54:31 -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 S232883AbiB1DQe (ORCPT + 99 others); Sun, 27 Feb 2022 22:16:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231213AbiB1DQb (ORCPT ); Sun, 27 Feb 2022 22:16:31 -0500 Received: from cstnet.cn (smtp84.cstnet.cn [159.226.251.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 97B7C4F476 for ; Sun, 27 Feb 2022 19:15:52 -0800 (PST) Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-05 (Coremail) with SMTP id zQCowAAH6fFdPhxil9m5AQ--.42410S2; Mon, 28 Feb 2022 11:15:42 +0800 (CST) From: Jiasheng Jiang To: peter.ujfalusi@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] ASoC: ti: davinci-i2s: Add check for clk_enable() Date: Mon, 28 Feb 2022 11:15:40 +0800 Message-Id: <20220228031540.3571959-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowAAH6fFdPhxil9m5AQ--.42410S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Xr47trWDZr1kKry7KFWkXrb_yoWkJFgEvw 4DurWkWr4rurZ29F9rCrWYyFnYgrsF9F48Wr92qr48try8Jr4rJ3yUZ3srur4UW3y09r18 Kryqgr43CrySvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb78FF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_ Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr 1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAK I48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7 xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xII jxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw2 0EY4v20xvaj40_Wr1j6rW3Jr1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY 1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbXdbUUUUUU== X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 fails. Fixes: 5f9a50c3e55e ("ASoC: Davinci: McBSP: add device tree support for McBSP") Signed-off-by: Jiasheng Jiang --- sound/soc/ti/davinci-i2s.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c index 6dca51862dd7..0363a088d2e0 100644 --- a/sound/soc/ti/davinci-i2s.c +++ b/sound/soc/ti/davinci-i2s.c @@ -708,7 +708,9 @@ static int davinci_i2s_probe(struct platform_device *pdev) dev->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(dev->clk)) return -ENODEV; - clk_enable(dev->clk); + ret = clk_enable(dev->clk); + if (ret) + goto err_put_clk; dev->dev = &pdev->dev; dev_set_drvdata(&pdev->dev, dev); @@ -730,6 +732,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) snd_soc_unregister_component(&pdev->dev); err_release_clk: clk_disable(dev->clk); +err_put_clk: clk_put(dev->clk); return ret; } -- 2.25.1