Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp950769pxb; Wed, 6 Apr 2022 05:08:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx1aLvwZl4ZYO03xO8RV+7b4zjFaqNdc4/vM6tqS+8E/XK5z5X6E3K0V8LfxP9Dga+je5S X-Received: by 2002:a17:90a:98b:b0:1ca:7f92:1bf9 with SMTP id 11-20020a17090a098b00b001ca7f921bf9mr9498554pjo.21.1649246927748; Wed, 06 Apr 2022 05:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649246927; cv=none; d=google.com; s=arc-20160816; b=cToT16WPI9Owb3X8yg6Ssy0Z8XKx3hKIfDcxT1C0ZgdsYJncpvbwDhY/5VWes2fRJq fC+xFfPpiT8uNPMR9BM8wTSaFnMyHMhbDKY67aGFUKPIFSnkdyLtfF+omHLs+K2mZ3et 0ArzabXHUCoK1OUjXniXZRz72B8Rfz83D93HyowFwE+jqZeN1ChM6mm5/dPAMpevl9Id XzkqokeZogUUoMnIGtHKJb4UKxqhhwH927jyxD6v8lK5TLg+x4NcatdAID/QkVFuYxU7 r6T6A5Mqlo7Q0WdjzhKvQE9ooJfkr0H5MU7xWQK6xY1NCXioEYXF4fn1xtPWxdiCT3To wSKw== 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=1XxfyMxuRzAtaapHtblunInwltt14j+qWgj7bLvFHag=; b=h3KvoM1rfYBI1219ZcpD7OHRKHGeF+LCCNP83QiECHZm49rFKFE2OoAP4lvzOEkOwO evnqh02SOZJwpD4H1abfVm0P5/5yJXPmDCwFyksgU9Ihj4meDJUosLew6y23olMf+jot fAJ9xcaamEaxQf+bKEpNkPPdAnLzq+oeiNz3uoJL3a8QacsvptGin7IlTzd9bI9UDkbS FjvKr2guIFEP4zRYVTYTxboU1nCpJuc3af45/svKdgKwP21CV/gACm9HPUZroQ8A/MNc OTM2sXxvDl7qfytWGf/XVzg2I9DbkpFohe5k567aa4ZXWMhjovcPhpWeqDg7o2H+ea1m Ujkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BDW838bi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id u19-20020a632353000000b00398b4d801d7si15857817pgm.448.2022.04.06.05.08.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:08:47 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BDW838bi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 DA0C04F963A; Wed, 6 Apr 2022 03:40:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1589005AbiDFASJ (ORCPT + 99 others); Tue, 5 Apr 2022 20:18:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348367AbiDEJrf (ORCPT ); Tue, 5 Apr 2022 05:47:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 496BC6D4C8; Tue, 5 Apr 2022 02:33:49 -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 D325FB81C86; Tue, 5 Apr 2022 09:33:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C955C385A2; Tue, 5 Apr 2022 09:33:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151226; bh=xSZkEnScJV/S1z08cBaoKDakLEQls9BjWgqvGeiGTa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BDW838biTkGCvfcVJBzqkgWnm8H+bq/3nmaz4PIgZ5nRK2A1MYFTIHjvzwoQWD7FZ PUpQtgZ+bAHpR4kTOEHNvDJBu4Izwr7qzrri56Kapc26gH8X7LTjhQXwEmWOZhXKPW lstp50QF3djC2cn2QELvSZ8CA/BoChLzhpOflEFA= 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.15 340/913] ASoC: dwc-i2s: Handle errors for clk_enable Date: Tue, 5 Apr 2022 09:23:22 +0200 Message-Id: <20220405070350.039637651@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 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 33ce257ae198..315ca5c4b057 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