Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3856171pxm; Tue, 1 Mar 2022 06:46:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTifVNolQ8MlbZb334mrC9k2m3hpW4P3R7ce/OUaoXRcsyUnya5EF/eV0+ZZx90kyATHsS X-Received: by 2002:a17:907:207a:b0:6d5:d9b9:38bd with SMTP id qp26-20020a170907207a00b006d5d9b938bdmr19028330ejb.556.1646145997101; Tue, 01 Mar 2022 06:46:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646145997; cv=none; d=google.com; s=arc-20160816; b=B4rWIBgH9vchFMlapNGrMXE7RunRNHMhI9UtlbVKIH/aNAg8pDOGHt5RjdyBme5h/F 5UXvk+OEvRVAqPhcS2sjQa6ntnyZr3HM2D5ZFVsaF3hfgxSvxXNuX9/zDzQBpjC2LlB+ YGA+/P5ewoX8oBYQhmC8Q8uOdYGltOSSh+vExEnuwFO4+2fvQ1EiM2eHvrrccR13czvN YXvC/ilyl8oeMCwXNS82+Gc5/sezpN4fRSDc6PIvv8jXbM+P3umlmeDZSY86sZWEBTZl KaFF1Mc5UVENY34YAOUHbry+1DdKrXQiIoZWol3WWrA6W7K1cj+zbUsIhZidzWlWOJyi jGkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1onpxNnFoCXsqo506jvf7SOJaOlkoC3XKwD8NMc9uTQ=; b=nLUuqH4PbYSQ56J/DWfC1mZw2Kcb9udni2dN9LgT+NLzh6rFGopNQ6IMu3rryVDQ/m huHXQSKspi0gtZSNN4w/IsrECjRgDSaHUNP9wEliD6iPF5SScqHz269ZhUQrHd11DZja 7Do2M5Iu1Exc+RZwCZ6OKFqCgtdcwivLykEg4u6Iw8B64p8u2cWV/T8xMGZdjlSdXfEr htnMGZkeXtU1ghPDw/wchTHiRcIasfUp/Al1UNQATANzqE+ntvcHwGdqydotmnEUn38S jLhSsS9nkQhwDM1N503FNCLUtm3LPlQP32uPPz+yCqUKHNE7fsnYY7rLfZaNfG0m8Bth 0Yow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=mrgSYljU; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020aa7cf07000000b003fa72ceba36si8960862edy.89.2022.03.01.06.46.14; Tue, 01 Mar 2022 06:46:37 -0800 (PST) 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=@bootlin.com header.s=gm1 header.b=mrgSYljU; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232388AbiCALTU (ORCPT + 99 others); Tue, 1 Mar 2022 06:19:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbiCALTT (ORCPT ); Tue, 1 Mar 2022 06:19:19 -0500 Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [IPv6:2001:4b98:dc4:8::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46CDD1DA4B for ; Tue, 1 Mar 2022 03:18:35 -0800 (PST) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id F1F13200003; Tue, 1 Mar 2022 11:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1646133513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1onpxNnFoCXsqo506jvf7SOJaOlkoC3XKwD8NMc9uTQ=; b=mrgSYljU26q9SyublNacGu2CJRJlEXAsqilOiDlbsTI3WISP1QS1VUesZ0AixgqWisvyoK aEq9vGYD0V0rkIWWOwTzg2MNvz+UHfg3XCG9oTaZMcuwXfUpY6xY0T7KXBwymDFGPAwD9S gGhs7Qf7QUy07EEwIgNu1ZzQkpEFpIjhSQNIIvO3mMLqFjQ18lcYmBUa6bBioQUtmu3Z7M U+b+NUQZ1JjgGF7ZrDwih1ojKwcV8ATShVp0xBr4/d6jCl4VPV/gNbmEHcuBEw/1Gn8Ivd C+5ippITlTrmBVKtF3sFQhz7mpHJv86z5L6Zv4n0kkH07IEPcUAeZqR93iEAcQ== Date: Tue, 1 Mar 2022 12:18:32 +0100 From: Alexandre Belloni To: Jiasheng Jiang Cc: codrin.ciubotariu@microchip.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, nicolas.ferre@microchip.com, claudiu.beznea@microchip.com, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ASoC: atmel_ssc_dai: Handle errors for clk_enable Message-ID: References: <20220301090637.3776558-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220301090637.3776558-1-jiasheng@iscas.ac.cn> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 On 01/03/2022 17:06:37+0800, Jiasheng Jiang wrote: > As the potential failure of the clk_enable(), > it should be better to check it and return error if fals. > As I already replied to an earlier patch, this will never, ever fail, this patch doesn't fix anything. > Fixes: cbaadf0f90d6 ("ASoC: atmel_ssc_dai: refactor the startup and shutdown") > Signed-off-by: Jiasheng Jiang > --- > 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.25.1 > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com