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 X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE91FC433E1 for ; Fri, 17 Jul 2020 09:10:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D57C62070E for ; Fri, 17 Jul 2020 09:10:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726673AbgGQJKI (ORCPT ); Fri, 17 Jul 2020 05:10:08 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:54759 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgGQJKI (ORCPT ); Fri, 17 Jul 2020 05:10:08 -0400 X-Originating-IP: 90.65.108.121 Received: from localhost (lfbn-lyo-1-1676-121.w90-65.abo.wanadoo.fr [90.65.108.121]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 87555E0019; Fri, 17 Jul 2020 09:09:59 +0000 (UTC) Date: Fri, 17 Jul 2020 11:09:59 +0200 From: Alexandre Belloni To: Claudiu Beznea Cc: mturquette@baylibre.com, sboyd@kernel.org, nicolas.ferre@microchip.com, ludovic.desroches@microchip.com, bbrezillon@kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 01/19] clk: at91: clk-generated: continue if __clk_determine_rate() returns error Message-ID: <20200717090959.GI3428@piout.net> References: <1594812267-6697-1-git-send-email-claudiu.beznea@microchip.com> <1594812267-6697-2-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1594812267-6697-2-git-send-email-claudiu.beznea@microchip.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/07/2020 14:24:09+0300, Claudiu Beznea wrote: > __clk_determine_rate() may return error. Skip the current step > in case of error. > > Fixes: 1a1a36d72e3d3 ("clk: at91: clk-generated: make gclk determine audio_pll rate") > Signed-off-by: Claudiu Beznea Reviewed-by: Alexandre Belloni > --- > drivers/clk/at91/clk-generated.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c > index 44a46dcc0518..995a13133cfb 100644 > --- a/drivers/clk/at91/clk-generated.c > +++ b/drivers/clk/at91/clk-generated.c > @@ -170,7 +170,8 @@ static int clk_generated_determine_rate(struct clk_hw *hw, > > for (div = 1; div < GENERATED_MAX_DIV + 2; div++) { > req_parent.rate = req->rate * div; > - __clk_determine_rate(parent, &req_parent); > + if (__clk_determine_rate(parent, &req_parent)) > + continue; > clk_generated_best_diff(req, parent, req_parent.rate, div, > &best_diff, &best_rate); > > -- > 2.7.4 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com