Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp980601pxb; Wed, 6 Apr 2022 05:57:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLUCwlOWwX5+/rmxIoyG1/vsZ9yZrH7il1bR1gtFvfmFTbsDQNTyOuRxpqapWtuJfG4LAy X-Received: by 2002:a63:310c:0:b0:386:afa:45bb with SMTP id x12-20020a63310c000000b003860afa45bbmr7118889pgx.133.1649249879424; Wed, 06 Apr 2022 05:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649249879; cv=none; d=google.com; s=arc-20160816; b=QE3G8/FVmq99WkXcqZ01WLUg9GXUoh72Z6KQFki10nYGPPWWafEJkCXlYe9jgQcPwk qEcqesnlSnuiTrrZClN1l/z0Yepvu9mLWJUGJ5nymmvRQF847H2vf4HFr2b4i/d2G6yu ibp0pogzGT3TvspQkvvpmXMhAHzxVVNq430pKlFD2LhdCkDDCeV+4WKC0lbrk6+kdOvJ j0DqWZ5fS/Yr9IH35OUJStZwp7qoW2N4YTyrnXm1AiDyPtKWqN1nHq3D06JlQaDgFP4E ELh1V5gqy6SrJIAr9/CVl+s0SaRBaWYCZAWg+aP9Ut+A5PeIRRtu2JKaoZ3KteEo79BS 4HUw== 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=Ypj+j3KWejJ/6czbsdVNVQ9q+LQtHsqwRNG32+azLRgEpga11Tb3R5G8WUy8Rr0z/3 MhmNfW+Cve6J5/s9ErIXRx41fdbRuArCAq//9XsmoS+tcL+dCHUZRcCLPBYgXSLayI4D ae8ZUFct3bc62qTRapOB6ytzTeZIbaf8z8JcazX90ZSLehpjiHUyO4uNjqD2KGnwSjXT mYOxNf6crXBOYu9+moLEVCV9QOvf/yVTHleRYcxpPYBP6q6F4k2hpdOHXL9gYQy4pZdj EyX/NwvuIfzXGHoDPsB4l5CooJA3BNJWZNsLj71Bww2wJNSgrdAiDVrImKI9lxUP7pdP 2GlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nbP3Nrpz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w17-20020a63d751000000b00393c60e611esi14496310pgi.861.2022.04.06.05.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:57:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nbP3Nrpz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D817299F26; Wed, 6 Apr 2022 03:08:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391310AbiDEWFL (ORCPT + 99 others); Tue, 5 Apr 2022 18:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348786AbiDEJsf (ORCPT ); Tue, 5 Apr 2022 05:48:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 105F87520B; Tue, 5 Apr 2022 02:35:17 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 720D261675; Tue, 5 Apr 2022 09:35:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83AA5C385A0; Tue, 5 Apr 2022 09:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151316; bh=kCf7i8CQ070ihBCpclSD5ljJByxCnKbymjN2NjY2v3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nbP3NrpzPaIKjo+X8Eq6SO6GNUpjFN1YaGZdVdoYZrxjcrXfbvA8Qc1DX2M0CXo71 7ImbaNiuxFqVtAchuLfPBm/MtqaCsbNxgxJn5iCsloLP49RoYLW0kKQj91z9950hjl DAiHtuj+HXqQNXL8xjQaNtqIYAJwr4QV74OcWhF8= 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.15 333/913] ASoC: ti: davinci-i2s: Add check for clk_enable() Date: Tue, 5 Apr 2022 09:23:15 +0200 Message-Id: <20220405070349.830628838@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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