Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp694134pxb; Tue, 5 Apr 2022 19:04:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPxa3hp4itVHF/9/WlPVpFbsPqOCYvx8rnFS8A1aVeHPq2a6JxqYdCSwolpLosLgqp8lHr X-Received: by 2002:a17:90b:4a06:b0:1c7:2020:b5b9 with SMTP id kk6-20020a17090b4a0600b001c72020b5b9mr7290049pjb.58.1649210591819; Tue, 05 Apr 2022 19:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649210591; cv=none; d=google.com; s=arc-20160816; b=nglIeRRFbpvNSyeyyBAUlH1OuKVMT0ytMTTRjvwCo4xJ2xNjbi1V0xecMaHp23W4HE BXsU6ydiBZ6CoNm7b2YzQ1wP1xPbjMqMTOhBUubFsbY/0+ueNiK1xVjUGSXnkHmh3ebq nNKvZcFO0XmcQzC9pr9NxvdCqd/kdgPXbfOup5G3KrvAfITcWmJNRdkqWWpdi4y32lSR HyHDM0vYr9cH4wFn6eOAD3FUnj6/J3Bx07z+dzkljNV20Pkz1aVwsE8S7yzvEHEf9VG6 U0fZPNH5BlkPik11IYqFQtxNNW7Zbs/Qeeh2HsMAVGuBhWPYbzwYslUpo1KJ7tOX0/+I fNoQ== 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=ZAhqA/VMN51q8isLpZe30JS3SXfX0yPYihFJAfxaN/s=; b=IgjikZjvIit2eod1Fe+rj7ZBTpnDlvh1FF3zgvmGZSQqwVNY3Z30ZpjMsX9zZ2J378 0Xpld+Lbz65Pjk3paKDr1mXzeWJ7vC2NTJIdIeozTIQBHGLuuCUOdv2emrcbnSjrTnQU LLPY2j3fqPTC6ZoCT4UWVSKXTKdyPXqx9ReRu5i7fuJpZ87YP1HDKwP0iQtzDnLtyhpD lApYaYtvrMhnVwGffqlheJANpA5bFwb78uGeusWNGqpnx0R7wLmy2jZDkMZC3i+TGFNm VqmTQgQsO3IiYtDbmBVMuzl6ysJ34nOTD8++M9DzpzmEhX3KkM9igPUYNy8ypNtVFCXu qWjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="VyF/0N/M"; 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 h1-20020a17090acf0100b001ca35559ee4si3448783pju.21.2022.04.05.19.02.53; Tue, 05 Apr 2022 19:03:11 -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="VyF/0N/M"; 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 S1382961AbiDEMRf (ORCPT + 99 others); Tue, 5 Apr 2022 08:17:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244949AbiDEIwt (ORCPT ); Tue, 5 Apr 2022 04:52:49 -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 7A4DD1A3BE; Tue, 5 Apr 2022 01:47:27 -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 1AE4B61509; Tue, 5 Apr 2022 08:47:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D67BC385A1; Tue, 5 Apr 2022 08:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148446; bh=crWXL8M3ZbJbxnQixr9aRZM4fdsgYuS+RPOQpMn+idA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VyF/0N/MY1ILm+Lbb8cwPbdjbUrElJpvkIeljNYOTLmXG6U8uH9L+EFmkR3tfQLOw XttoUuueLClF6WajJdNApjr6QZmlTaxAHVTnUv8LSu469z2hLtHOj779JwV/V1L1z/ q14G+FvSih9xqAiC9nFPiKh2OAksa7Z8OZFPzKO8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Mark Brown , Sasha Levin Subject: [PATCH 5.16 0361/1017] ASoC: dwc-i2s: Handle errors for clk_enable Date: Tue, 5 Apr 2022 09:21:14 +0200 Message-Id: <20220405070405.000611637@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 45ea97d74313bae681328b0c36fa348036777644 ] As the potential failure of the clk_enable(), it should be better to check it, as same as clk_prepare_enable(). Fixes: c9afc1834e81 ("ASoC: dwc: Disallow building designware_pcm as a module") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220301084742.3751939-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/dwc/dwc-i2s.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index 5cb58929090d..1edac3e10f34 100644 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -403,9 +403,13 @@ static int dw_i2s_runtime_suspend(struct device *dev) static int dw_i2s_runtime_resume(struct device *dev) { struct dw_i2s_dev *dw_dev = dev_get_drvdata(dev); + int ret; - if (dw_dev->capability & DW_I2S_MASTER) - clk_enable(dw_dev->clk); + if (dw_dev->capability & DW_I2S_MASTER) { + ret = clk_enable(dw_dev->clk); + if (ret) + return ret; + } return 0; } @@ -422,10 +426,13 @@ static int dw_i2s_resume(struct snd_soc_component *component) { struct dw_i2s_dev *dev = snd_soc_component_get_drvdata(component); struct snd_soc_dai *dai; - int stream; + int stream, ret; - if (dev->capability & DW_I2S_MASTER) - clk_enable(dev->clk); + if (dev->capability & DW_I2S_MASTER) { + ret = clk_enable(dev->clk); + if (ret) + return ret; + } for_each_component_dais(component, dai) { for_each_pcm_streams(stream) -- 2.34.1