Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3046145pxb; Mon, 18 Apr 2022 14:22:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/hZK5GdDQHbkHTmNsK1/Ksx/dl185+BsebQgzh/u2LL8kkh6tOQRkygiUV5ICPDLFTg4j X-Received: by 2002:a17:90b:3ece:b0:1d2:aee9:23c8 with SMTP id rm14-20020a17090b3ece00b001d2aee923c8mr4412537pjb.112.1650316965013; Mon, 18 Apr 2022 14:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650316965; cv=none; d=google.com; s=arc-20160816; b=atqcJKxcNEWiUZKOCDQeOZJdKqmcwABKD9UdP/kFW6QCkOxelwCDirxE6+3G+Zsk2n hXr549xS2EeClbQPqTutRb12PNQpQhPTJwZTZYG/wK5QDxIj9QvQuvaCHIPiKaYPgfWO Bvg+iwyOzhkylP7g1XM8Bdjf4BDxOmYWH1tUXLypDt0ecJqPQgJHi3TECXOcL3JUFyLg 8c+9knhPmokFj8LXoDvrJjV8HyZAUGZfz8h3ahyu4O806f12qJzc+NN0QQ8SLbiDJs/g oG9DMS0EtunU/aSJLL36cy8Tn68WpixyooDQIBugBO70GXsAw386Pub8lU1nxy7IYN8B CP2g== 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=sbYIZEj8hW1V6ZNxk06654UgYHXNJZ2RkJX2TEfQvwk=; b=EJ8oFIugAUwqVXDaeCuFV9bcrKdd5ruRQBTt5l7jlqTFIRT+qlA5WPVPL1rRpeS89p 2cZFmVIKb0b+phDfj+TRYmuXEIN8x23T//Bb5zJm3Yb6F5EWLFWvoVegsuAIwQd4i5gB KdrRfY5FoBAlKYUUZqG2KaJ0xbyLvjLUpekNxxy3cEPAW1/X59LfMw5GIdc3TZH6YIN4 hq6fmZFKAqre4cXomUxrglWS3bVlf+QyDhQ1zUYH2KyBdrn+n/2KG7M511ZvppHQJQ9d MI9TNAMd4nh/XS/Px5OK/YdJ+Nf09fWAp4CzltVsh7kUFeFntjxukZ/mxeyWG3Dy+chx Mh5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ei3kUWxw; 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 lp4-20020a17090b4a8400b001bf756ef81csi347242pjb.139.2022.04.18.14.22.29; Mon, 18 Apr 2022 14:22:44 -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=ei3kUWxw; 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 S243485AbiDRNl6 (ORCPT + 99 others); Mon, 18 Apr 2022 09:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242086AbiDRNNV (ORCPT ); Mon, 18 Apr 2022 09:13:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72D323A1AE; Mon, 18 Apr 2022 05:51:02 -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 DD28D61287; Mon, 18 Apr 2022 12:51:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3DE9C385A8; Mon, 18 Apr 2022 12:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286261; bh=FJARBZBjsKTFIZCwEbBcLJQp8/d4yzz5kJwdbs6GYbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ei3kUWxwt+VM3jeF+FgOyCJ2sZ/+oxzOxHEIkEGWlZ/r96EMPqQyqN67mMIByjNMh erxm3TZi4TLrktSMQyUJAqkQdhwGjGnq5HJBSwrB+4ZSVAG9YRA3r1ADw/UDJa33Qt 8eajziq4RWonUZ/8v7KBLrJRiPEAmgTFcQmApro4= 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 4.14 077/284] ASoC: ti: davinci-i2s: Add check for clk_enable() Date: Mon, 18 Apr 2022 14:10:58 +0200 Message-Id: <20220418121212.876495581@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@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.7 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/davinci/davinci-i2s.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index 384961651904..e5f61f1499c6 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c @@ -719,7 +719,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); @@ -741,6 +743,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