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 D608BC433F5 for ; Wed, 2 Mar 2022 09:51:36 +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=nYO4sK8SzvYP2NQF1mga0HznzFw3wpTlEoNxcpSEE3Y=; b=dmg6hn68H/Jqu+ agcc0lfqHR493CMWz+nx+u1jhfsZhS/3NGSiRYujAr8URQYNG7dWcPcF08U98dviVmvn+roMTEx3e 3tnP2sCdkSkBGKrloV9Po3FNIosIRXIWhVyM38ZK5NqwZRfjQ47wvomZXLL7waRgBQPtad8DW/NRN twDDTqXr9qoggciYGKvWEftx3yRzKX6T8zFIG7U97nDd/8fau6RCaYRUvAClomeidVNNuE/xrQJVX mxB5cODNSp1OBZIEqopiy09uK05k0+d/FGM5jMEpxF349aNIUqU+n0oH2uKFmFZUgJ82fI/suQvpV 9Q0nDQ4rhF/FIuOdyYTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPLbW-0027hb-MK; Wed, 02 Mar 2022 09:49:06 +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 1nPLbQ-0027f9-5U for linux-arm-kernel@lists.infradead.org; Wed, 02 Mar 2022 09:49:02 +0000 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 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-Disposition: inline In-Reply-To: <20220302084319.96435-1-jiasheng@iscas.ac.cn> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220302_014900_407522_8ADD88CF X-CRM114-Status: GOOD ( 19.17 ) 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: arnd@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, codrin.ciubotariu@microchip.com, 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel