From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72C95C433F5 for ; Tue, 1 Mar 2022 11:19:35 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6D5911AEC; Tue, 1 Mar 2022 12:18:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6D5911AEC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646133573; bh=pjS2o3inJdkY+itN4TE9HmTjybISLxWDIoEs9DorWBw=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=U93GQ0+B5QxXEjsfmngaVWlRpf7TJlPleRS9ezUeowQzpXmmkA3VebCJRE0hfTHSu vY8zueJJ6/5FnpGFcXcNVoamG/DtxxU6wNoOdiH1CdcR4ppSxwyYVxIp6TRu0pyJHp Z3CJdV2G04uNWhJQTk+wed48/plGAMEK4AZQRBWM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 03CFFF801D8; Tue, 1 Mar 2022 12:18:43 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 07884F80227; Tue, 1 Mar 2022 12:18:41 +0100 (CET) Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C63DEF80095 for ; Tue, 1 Mar 2022 12:18:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C63DEF80095 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="mrgSYljU" 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 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> Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, nicolas.ferre@microchip.com, tiwai@suse.com, broonie@kernel.org, codrin.ciubotariu@microchip.com, claudiu.beznea@microchip.com, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4507C433EF for ; Tue, 1 Mar 2022 11:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aWpxOxLe/A3q4dyNJASsEKBPP3CA8VaglQy/joa1PHY=; b=XPixBSUqQPYLQV 2Ty7m5/c0qr5dYk9uAvq5jPm333lWYiApeSYh3HKdsM0Ba6qwRTwzttu61SnEyy6NSCs+n6u75/cG tObrzrnKP3sGcMy4QawxT7W8L3PU5ktvJ1IBCH/jRY7yTv9AjtudFXw5ovv8cj2kJrB4TIzlq52WE LhOaxWXAr5m7jY8EAaalWZ+L1SNs/t3M43iH7T1smXkQ5VIpcCCvB8fXRfYAgxfow6fNJ5XI8EkXL KkXD7/abiWfpOYR/bN4BWozRw6OAZNZuaNei3tXOL/HNynMCPXUJmQDgJHUx3/xyKQ6lJFBAM0RLs XT10WzGLsBJI4Nw7IxRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nP0Wp-00GO36-5W; Tue, 01 Mar 2022 11:18:52 +0000 Received: from relay12.mail.gandi.net ([2001:4b98:dc4:8::232]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nP0Wc-00GNyQ-Eb for linux-arm-kernel@lists.infradead.org; Tue, 01 Mar 2022 11:18:40 +0000 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 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-Disposition: inline In-Reply-To: <20220301090637.3776558-1-jiasheng@iscas.ac.cn> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220301_031838_969644_D056344B X-CRM114-Status: GOOD ( 19.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, tiwai@suse.com, broonie@kernel.org, codrin.ciubotariu@microchip.com, perex@perex.cz, claudiu.beznea@microchip.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01846C433F5 for ; Tue, 1 Mar 2022 11:18:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233136AbiCALTV (ORCPT ); Tue, 1 Mar 2022 06:19:21 -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> 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