Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp663853pxb; Tue, 5 Apr 2022 17:51:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/XEJiY7Cm9qrIbSkjfhK6V7rNi+EAbWGF/pFbCRoqnqRXWvOBLlC3dQp3ZeQbd/wubzC/ X-Received: by 2002:a05:6402:184c:b0:41c:dad5:72a5 with SMTP id v12-20020a056402184c00b0041cdad572a5mr6099376edy.254.1649206315920; Tue, 05 Apr 2022 17:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649206315; cv=none; d=google.com; s=arc-20160816; b=JM19cgFtBDErDZI4Mf+naTUnhiO9+ulElPqpf2GchA/+93aW/GyAWxnwHA9k2FodRF CebsjtCH+K9aG/9ud0pU4jYfVfkZ0At0kApSS2ovbn5SRKe5YnkWA6UeVZdrJ5MME82P hYEpCRz/Mq+0tCwau2Sa86v9WHhBit1RbvFYc9f7uJPXi2JD7YCsUFLtnjcD+6ymigek L8EwMhMl8kNib7Cm0FgnOlPUCmcjHogYtWyIJuK6BlHOFC6tvn3RQsXe4bnFblol7eEQ RNId07JWU6IzBv0Mc4kCooVQP2YyLH7IBqX9KBH30JuMeGjR0KK8uJ1DCGUuMHCct5YY pZLg== 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=AriheVfGqAT2GzH+gjCdT8AyPusYoGlBVpIf7SDernQ=; b=iZN4iAqFdAWGMemlKVdpJesUyN9baEkzpEFXZs+aNyO689lffjI3c8EikPVafyp1OB 6Qv5Een0caapLO3zWGBB3ONAWzBRJ28igukP43/P6hyfPzW7JI8YToyOkGac+WFxqp9z /KKreFZ10Ev+nZL6T5z9kFZ+IlZi9Cj2TdDzDK4HVQzac3BuSlLKHvEkh+5o2Wlq9wGJ yDylWTT1ZSHUyZ7j94boUUiccF8ra37j9cj50PsZC+L9SAmmeiJ6YWe9hT0mOsFNL2SU u7gVGJkrdRPD+OIuSFjgG56wUvGeyWFY6pQwLl6Wap0MLJ6s7qcEv9kxo3NXugbAUSM4 kY+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qav+hcWE; 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 kb1-20020a170907924100b006e7f67f0daasi4824632ejb.689.2022.04.05.17.51.21; Tue, 05 Apr 2022 17:51:55 -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=qav+hcWE; 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 S239695AbiDEIUa (ORCPT + 99 others); Tue, 5 Apr 2022 04:20:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235634AbiDEH74 (ORCPT ); Tue, 5 Apr 2022 03:59:56 -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 A235C1AF3A; Tue, 5 Apr 2022 00:56:36 -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 4EF32B81B18; Tue, 5 Apr 2022 07:56:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A454FC340EE; Tue, 5 Apr 2022 07:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145394; bh=DuYmSyEzedX7U/nY9Gg5hYz0dMAKEediBXzyg56hMdA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qav+hcWE46twwS5cupmpMzvQ03YCwF2/LUhMBY8J5nT6a8PwnWOWSRqVDe8WgHBt/ taXYdMtS42+jxhD2usR7LdI/LdpRkxkK2KUMTOCpCCgKVvg64MdKLFlN/hxwSsritH LdzL8mrAZNZ2OKs6vkgrDBpP5AYSo9uCvHoyL00Q= 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.17 0382/1126] ASoC: atmel_ssc_dai: Handle errors for clk_enable Date: Tue, 5 Apr 2022 09:18:49 +0200 Message-Id: <20220405070418.838826040@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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 f9e2ca0640e59d19af0ff285ee5591ed39069b09 ] As the potential failure of the clk_enable(), it should be better to check it and return error if fals. Fixes: cbaadf0f90d6 ("ASoC: atmel_ssc_dai: refactor the startup and shutdown") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220301090637.3776558-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/atmel/atmel_ssc_dai.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 26e2bc690d86..c1dea8d62416 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -280,7 +280,10 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream, /* Enable PMC peripheral clock for this SSC */ pr_debug("atmel_ssc_dai: Starting clock\n"); - clk_enable(ssc_p->ssc->clk); + ret = clk_enable(ssc_p->ssc->clk); + if (ret) + return ret; + ssc_p->mck_rate = clk_get_rate(ssc_p->ssc->clk); /* Reset the SSC unless initialized to keep it in a clean state */ -- 2.34.1