Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28874287rwd; Wed, 5 Jul 2023 04:09:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlFKGGwoTYJkwZvCzIHeDy69EVMkz183CjpPVg8xa+QpDsfnN6mvLOa9Q7jquQqurBC+T7NC X-Received: by 2002:a17:90a:358:b0:263:e804:3988 with SMTP id 24-20020a17090a035800b00263e8043988mr3625938pjf.1.1688555364740; Wed, 05 Jul 2023 04:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688555364; cv=none; d=google.com; s=arc-20160816; b=MRaR32UG0/n7QTM76VS4KQLFqzRQC29ydpi2EtKJZWEaMDQuTpbKu3Mz2Lvj4MlpZ4 SfyxuD3K/kX/pLhNcjJeFOSweTqqxrh730U52PMVzTUtTjNhObcMcdqmgv33Mznkz34+ lPuGrpm7Ms+OSm+q0J3fLAcCnLUhu3WtCrJ42thc1v4+M42EL6pFtCDellsoGArcSrmm S51U0QgFnpRT97HnpTwGjQ9AxTxeiD3p3rTUnP1871vlsNWnCIHkTQAKjy1xiuZ4dvr5 jZj9EX5YZg9uIVA72SMtrWlyO+VbAIHghatLdygHb0HueJ+AC4so/tr7dzyiRuoLJHOm X+zQ== 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:date:from; bh=j0YzJEZ9/lK1ImQFLu1X1MSTBkgEaFh58bNc9IwKo0E=; fh=OADTMQA0ZPwB4hRRjm5DVX42NeOFmIY9eo8ftDeTH3g=; b=DyPzJCGyHyVMVbyIQS7Z9NYj9jAqomnvNychXWhBDS9IXkkaaqUoIKHI0zrX/rLhjS 3WfereC6iL6X0MwPeTi4km5zYcKa9M7hcILXOCaeZWgfMn34TRLFlqAZjSNRANQuPx8n X/jZOrGL7PPUT7BOOyD6l7fTW0QJCsw53K7XG7eZTYdqV7Dlvq7aTajWVa3rtQ6YF8WT 7juGpN6hz+100znsBWwe0mSPOOV1XXbatPrILP6/8W+M8zfJpkH6h3Ge+dGgVtOP6BuR dVcaUssWazUqOnYRzokZVWvTpEBgoj+yv8GRFkWQ7r6sgr+lNitqqjIDfQS9Hgm9Zpg3 RABA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s63-20020a635e42000000b0054fa5eb5283si22771189pgb.165.2023.07.05.04.09.09; Wed, 05 Jul 2023 04:09:24 -0700 (PDT) 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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230100AbjGEKTK (ORCPT + 99 others); Wed, 5 Jul 2023 06:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232006AbjGEKTE (ORCPT ); Wed, 5 Jul 2023 06:19:04 -0400 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62506E4B for ; Wed, 5 Jul 2023 03:18:56 -0700 (PDT) Received: from localhost (88-113-24-87.elisa-laajakaista.fi [88.113.24.87]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 57fcbf88-1b1d-11ee-b3cf-005056bd6ce9; Wed, 05 Jul 2023 13:18:54 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Wed, 5 Jul 2023 13:18:53 +0300 To: Martin Kurbanov Cc: Mark Brown , Neil Armstrong , linux-spi@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@sberdevices.ru Subject: Re: [PATCH v1 2/2] spi: amlogic-spifc-a1: add support for max_speed_hz Message-ID: References: <20230703094518.53755-1-mmkurbanov@sberdevices.ru> <20230703094518.53755-3-mmkurbanov@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230703094518.53755-3-mmkurbanov@sberdevices.ru> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, Jul 03, 2023 at 12:45:18PM +0300, Martin Kurbanov kirjoitti: > This patch sets the clock rate (spi_transfer->max_speed_hz) from the > amlogic_spifc_a1_exec_op(). ... > +static int amlogic_spifc_a1_set_freq(struct amlogic_spifc_a1 *spifc, u32 freq) > +{ > + int ret; > + > + if (freq == spifc->curr_speed_hz) > + return 0; > + > + ret = clk_set_rate(spifc->clk, freq); > + if (!ret) > + spifc->curr_speed_hz = freq; > + > + return ret; The form ret = clk_set_rate(spifc->clk, freq); if (ret) return ret; spifc->curr_speed_hz = freq; return 0; less error prone in case some code is squeezed in between. > +} -- With Best Regards, Andy Shevchenko