Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp720547pxm; Wed, 2 Mar 2022 07:14:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsECFyY8eB35MXFVC28Z4O/cFaOIOcXI/lbLoq639UlKnpSoq7JOZhUclLW2l6iNAdzwW8 X-Received: by 2002:a17:902:f602:b0:14f:53a8:64f7 with SMTP id n2-20020a170902f60200b0014f53a864f7mr31094881plg.151.1646234046933; Wed, 02 Mar 2022 07:14:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646234046; cv=none; d=google.com; s=arc-20160816; b=ja8ERaAtFAAevFuDOdT6mPoprrgND0qlNtyYujc94kIDnac28FGk+JjqvAlVXN3C9P S0CAYIrUH6kGuvrA7nVjnJFGp7s9fS8GrRekFDXuNXngeCIl+RGI5sbomHQA33+g4ofQ rJIwpDvNNoXNbrf/NWCk36xLsmrgTE5dQkoFxOytoNFTUwIokG8aUpZzReOpoBQBhIoZ x/ZI7vLHCYwtRMRk9KSB+PaiRQlRDzyk587RHXCUeNtN4bZ28+sAmnB88IakLiLoSWAp cLv6153+ehO1Mfukxw5upPbT3nVlSjwrZP4U5E7z555/Z7/JZyfBipfhbjrVDRiiI2bG Pk7g== 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=XONB/+Q2uIiRe6FA91u/IHYG5GnofPRpfBepye8euXo=; b=bkZgCwf2EAKiSKI+iqenOJkFZtbS2u46bteapparFw7V6xjNss5gb84qJ4KmTipdVn 3Rj6Alf7C/H+vSWb12qX9gKCd+m5HnZgpEi8TEl8r3bjHRdjCCSNInaasQn6Epnwi9I1 72sfCzFJTyvuefe3Yn6z5rQwHWpZu8WihWTKKyh6FROsSCJFwxvA0lk3RNhuYgK3Pk7C 9MrNotBKY0ahGV/DCxUglq/j0WwvtIhIIMPuwmaBkicsYcjuC+G/OMOh3JU68sw67W0q SDjcKLLn1e9l9rxVcfuPBE622NMvuUtI7B4UP1/c1+uaYXbQsqYMJ+7RPtQzCAvdOWvn AZVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=UqmIVn9a; 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 q16-20020a17090a431000b001bc717613easi5018914pjg.85.2022.03.02.07.13.43; Wed, 02 Mar 2022 07:14:06 -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=UqmIVn9a; 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 S234279AbiCBJto (ORCPT + 99 others); Wed, 2 Mar 2022 04:49:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232674AbiCBJtn (ORCPT ); Wed, 2 Mar 2022 04:49:43 -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 D550CB91DC for ; Wed, 2 Mar 2022 01:48:59 -0800 (PST) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id DA30F200004; Wed, 2 Mar 2022 09:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1646214538; 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=XONB/+Q2uIiRe6FA91u/IHYG5GnofPRpfBepye8euXo=; b=UqmIVn9aM+peXOb7taEyk50/TbWkselngS71kTQC+m6EVIR91a3vgS/LXkLSm4VbNJRHAt mRQnkT8cXd1Yqq+4gVX1CDoeqVrXpe7xdXY53Lqcww4gScaa0V7j3vp6Rmk4rdcupp8mDh A3zrblyHzHHVfSYi8atnh5kBYM09Dl533z9/2FmoYTN/5m+MfBoj4ZlXvKArsAyYwpm4Co US/BGQkjPd/N6gjexmmlEEXwzBA8aBOPkiAWzo1s36RktWKKWdbos5ymX1RY+NXV5rnKEF sSYvsaF/ZVbwb3ItryvGFG0gltIvsHlCReVVS8dxtX9XBxulXsqZ201bm6cLPQ== Date: Wed, 2 Mar 2022 10:48:57 +0100 From: Alexandre Belloni To: Jiasheng Jiang Cc: codrin.ciubotariu@microchip.com, arnd@arndb.de, gregkh@linuxfoundation.org, nicolas.ferre@microchip.com, claudiu.beznea@microchip.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] misc: atmel-ssc: Handle error for clk_prepare_enable Message-ID: References: <20220302084319.96435-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220302084319.96435-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 02/03/2022 16:43:19+0800, Jiasheng Jiang wrote: > As the potential failure of the clk_prepare_enable(), > it should be better to check it and return error if fails. > this will never ever fail, this patch doesn't fix any actual issue > Fixes: eb1f2930609b ("Driver for the Atmel on-chip SSC on AT32AP and AT91") > Signed-off-by: Jiasheng Jiang > --- > drivers/misc/atmel-ssc.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c > index d6cd5537126c..c76ca234af4b 100644 > --- a/drivers/misc/atmel-ssc.c > +++ b/drivers/misc/atmel-ssc.c > @@ -192,6 +192,7 @@ static int ssc_probe(struct platform_device *pdev) > struct resource *regs; > struct ssc_device *ssc; > const struct atmel_ssc_platform_data *plat_dat; > + int ret; > > ssc = devm_kzalloc(&pdev->dev, sizeof(struct ssc_device), GFP_KERNEL); > if (!ssc) { > @@ -226,7 +227,10 @@ static int ssc_probe(struct platform_device *pdev) > } > > /* disable all interrupts */ > - clk_prepare_enable(ssc->clk); > + ret = clk_prepare_enable(ssc->clk); > + if (ret) > + return ret; > + > ssc_writel(ssc->regs, IDR, -1); > ssc_readl(ssc->regs, SR); > clk_disable_unprepare(ssc->clk); > -- > 2.25.1 > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com