From patchwork Sun Sep 17 22:40:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Bara X-Patchwork-Id: 724034 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22ACB7465 for ; Sun, 17 Sep 2023 22:40:43 +0000 (UTC) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D274E133; Sun, 17 Sep 2023 15:40:41 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-404c023ef5eso20885805e9.2; Sun, 17 Sep 2023 15:40:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694990440; x=1695595240; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=kxgzRC83NEd59zuKYNAtW33VSR0RcAZP2Du3OW3MEsU=; b=GXF4INtM+N8DSHlep15jKUVWIp9r/WKwCl8Fjop4IdKCNs+55zs6CsmZHdh5+vWzax 2j1MQkQLsFQLAG6+HiIfVqVIhNeuTNlmhUZw7/cvXNlTbunHy2lPjh4dVeh/B1MtiwM+ aNEItpncQEkmeH5JyWBeN72R1YED3F2puB5a4w/8d0bRxcU6KXhTbXYqUUHqr4lTM6Q1 2p9exjVZbpjnc4u+G+6MFfJXOSgCm1Eg8D5CfLR6IrGwh2q+jZzwTVQEPpV388wLJVmK RZhgdsDXTgLEvqXIrU75R34yLu7b7xdQVnfzgiKqrpQGUVhpXApIbXkCH83igLEY+QdW mWKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694990440; x=1695595240; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kxgzRC83NEd59zuKYNAtW33VSR0RcAZP2Du3OW3MEsU=; b=mJxpvT/3SVLFW4N+UrjAsOBMfLtHXVjSKWzRH40ez5V1D/Xk1gclRyFzL6z/K5DNCy DAq8nVPs/IJl4t9YKjHjfnfvQ7c3A3SfacKUO2N6gcvvHKL+YGUcSQ4eVJIc5WiLZ2Pu QHuuLLxuWsxi2HrJhQcNIx2MzYwnq7lx0IYShpRr48ryKifEweK0nzua/Het7sRxi0+h MoLDL7UZWPxdUB6EiInOp8rfrf6VieicgCRchkM7Cd8FzxSemR92nK7IgW80BsA0/VOe SnoowwVH1DdAPnVAb6O3fv08fU9IYH5DgOHrDIjdox3Zv7HxV1+0HKFXlMbHjF0ZsQ54 vvcQ== X-Gm-Message-State: AOJu0YyamfmwwYYuMg/ytdXF8puoyP00TVs95bbO5rXbSTXLHgPsPQ/C GjUA9C1J/bGRiCSBT8ul6zM= X-Google-Smtp-Source: AGHT+IFoSWsvTCvogylPfTef05sJwd//OcFKTET+KddTyezT5DcPj/b0Rpvtp0gJKAXf1ocmhph9HQ== X-Received: by 2002:a7b:ce07:0:b0:401:bdd7:499d with SMTP id m7-20020a7bce07000000b00401bdd7499dmr6467049wmc.25.1694990440181; Sun, 17 Sep 2023 15:40:40 -0700 (PDT) Received: from [127.0.1.1] ([91.230.2.244]) by smtp.gmail.com with ESMTPSA id x14-20020a1c7c0e000000b003fe2b081661sm13642931wmc.30.2023.09.17.15.40.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 15:40:40 -0700 (PDT) From: Benjamin Bara Date: Mon, 18 Sep 2023 00:40:06 +0200 Subject: [PATCH 10/13] clk: imx: composite-8m: convert compute_dividers to void Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230918-imx8mp-dtsi-v1-10-1d008b3237c0@skidata.com> References: <20230918-imx8mp-dtsi-v1-0-1d008b3237c0@skidata.com> In-Reply-To: <20230918-imx8mp-dtsi-v1-0-1d008b3237c0@skidata.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Michael Turquette , Stephen Boyd , Russell King , Abel Vesa , Peng Fan Cc: Frank Oltmanns , Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Benjamin Bara X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net From: Benjamin Bara As the current implementation cannot fail, drop the return value. Signed-off-by: Benjamin Bara --- drivers/clk/imx/clk-composite-8m.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c index 27a08c50ac1d..a121f1285110 100644 --- a/drivers/clk/imx/clk-composite-8m.c +++ b/drivers/clk/imx/clk-composite-8m.c @@ -47,13 +47,12 @@ static unsigned long imx8m_clk_composite_divider_recalc_rate(struct clk_hw *hw, divider->flags, PCG_DIV_WIDTH); } -static int imx8m_clk_composite_compute_dividers(unsigned long rate, +static void imx8m_clk_composite_compute_dividers(unsigned long rate, unsigned long parent_rate, int *prediv, int *postdiv) { int div1, div2; int error = INT_MAX; - int ret = -EINVAL; *prediv = 1; *postdiv = 1; @@ -66,11 +65,9 @@ static int imx8m_clk_composite_compute_dividers(unsigned long rate, *prediv = div1; *postdiv = div2; error = new_error; - ret = 0; } } } - return ret; } static long imx8m_clk_composite_divider_round_rate(struct clk_hw *hw, @@ -80,8 +77,8 @@ static long imx8m_clk_composite_divider_round_rate(struct clk_hw *hw, int prediv_value; int div_value; - imx8m_clk_composite_compute_dividers(rate, *prate, - &prediv_value, &div_value); + imx8m_clk_composite_compute_dividers(rate, *prate, &prediv_value, + &div_value); rate = DIV_ROUND_UP(*prate, prediv_value); return DIV_ROUND_UP(rate, div_value); @@ -96,13 +93,10 @@ static int imx8m_clk_composite_divider_set_rate(struct clk_hw *hw, unsigned long flags; int prediv_value; int div_value; - int ret; u32 orig, val; - ret = imx8m_clk_composite_compute_dividers(rate, parent_rate, - &prediv_value, &div_value); - if (ret) - return -EINVAL; + imx8m_clk_composite_compute_dividers(rate, parent_rate, &prediv_value, + &div_value); spin_lock_irqsave(divider->lock, flags); @@ -118,7 +112,7 @@ static int imx8m_clk_composite_divider_set_rate(struct clk_hw *hw, spin_unlock_irqrestore(divider->lock, flags); - return ret; + return 0; } static int imx8m_divider_determine_rate(struct clk_hw *hw,