Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp707103pxb; Tue, 5 Apr 2022 19:39:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuIc6mT/veCDZb03EhGhar1xf209f7RyxauTeXY8jmgYL8//doWJhoHDPvUncst5+naaq5 X-Received: by 2002:a17:906:99d1:b0:6df:f83e:da21 with SMTP id s17-20020a17090699d100b006dff83eda21mr6260333ejn.462.1649212767818; Tue, 05 Apr 2022 19:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212767; cv=none; d=google.com; s=arc-20160816; b=RkisbYcwfc6Yil5+vy8pZ+O84TPpLrCkKiUf/p/ktZ5+MPSVFHasH0TLwCXgmJaD54 z3FUlIrLTPlKEUvLdKut77j4+ob1iTnXAXUYdrHtxy5b14F03Osd8egybzXgNsLd2kLW D7/ORaWtfZ8RLQ8sCCLX9bWDWFuO2OFg0aPo910EcdOk8EYJaIQJLzdQyrOQlO5/haZn lXEh01M6ANj4r9cQkI6UdseH2+X6MZnEP1YQ4QHxD5UiERqzX88igmo1CkAhD6aY3r+c h7xfvYdabpHr5dCmjJNtCQ1OK7mfo0L5urUFSfLv9blMItQ5x7xDXNuhZqiXrSxMDZRT aV3A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gZqRSnb5BFYZhzwa56ZPaiy49/aUK6fZkecBuyRgLtU=; b=LpMo48vp3ETF61kXnvPaPzBNbEJxAqKei/h75jcg1wS755ZSPUI1dvvodm86LR3OMl 6UGqM7c3xJ6r4FavKoKamTW/+08LEz0aQB7V8NtqB2WJxmMOwGVAeszwHHJiJfi74qW/ 1fKikI1dyurAWd8UCPfebTFoPh3H/8SH4MOnb9jWpuvOIH+fpUQuoNFOvwr2tiGvfUfK uiAUs6cv3RbZYZ2+oYZqS7EWPPVzJ5QafGiTuXVRZ5GLqUV+ykcin8PONI06TmGkm9Sp r02tJqidKIk67fHH2xY5fdrN3X1qsCzPJy47AOHTAWX9RbxDaZtgO/o4988v+6lnc5Xb LxKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Yw+spYT2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id de11-20020a1709069bcb00b006e7f65c37aasi5094049ejc.985.2022.04.05.19.39.03; Tue, 05 Apr 2022 19:39:27 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Yw+spYT2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382653AbiDEMQZ (ORCPT + 99 others); Tue, 5 Apr 2022 08:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244939AbiDEIwt (ORCPT ); Tue, 5 Apr 2022 04:52:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB0F12497C; Tue, 5 Apr 2022 01:47:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 74279B81A0C; Tue, 5 Apr 2022 08:47:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA432C385A0; Tue, 5 Apr 2022 08:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148427; bh=kCf7i8CQ070ihBCpclSD5ljJByxCnKbymjN2NjY2v3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yw+spYT2w0MvdbRvk4eChLVotBS7zYQrGAg7+0RC+JwYSivYqmtgy/2Zx3OCdCUX6 HIQAJU0ijY56QAEcl7GRiwGaSRYdmKIFq62VReLSlXI9IqVCws4BdJUzZFJu7JOFot eh1fmnc7+cF2aE/RrdB1JY7VzlIryGDp0nLhMWjg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Peter Ujfalusi , Mark Brown , Sasha Levin Subject: [PATCH 5.16 0354/1017] ASoC: ti: davinci-i2s: Add check for clk_enable() Date: Tue, 5 Apr 2022 09:21:07 +0200 Message-Id: <20220405070404.792953766@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 From: Jiasheng Jiang [ Upstream commit ed7c9fef11931fc5d32a83d68017ff390bf5c280 ] 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 Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220228031540.3571959-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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.34.1