From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D01321FE45D; Wed, 25 Feb 2026 01:37:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771983422; cv=none; b=tQjuGY3Qe/9+fynSb7tnYcESoNCuHHrF4AM35VlXZhN7p2xTUiw6Wxy0tmJiB2RbsqJK6KL3Bh+Jba+CAnAC6ly3af6Gb+LwleSKXxo13q7t4dB5iksI63/3sqYzj4QwRmAti+mlS77Wcm/t57bgHWrMdvktiLewcdYl02jBIgc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771983422; c=relaxed/simple; bh=4tqbIGQN7MIKsDrFeM3MNrHSPyj0b1KGetqKKpgbu+Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hEU3UCSvYbIvox/3bMyqCKWT+gV3DGgsMmPwRWE3HKAS5CzQ+FtlI1ljzF9TpD1itzDGwg1cDmgHmjrs3fD3GC7SxpDeUkHFcdwtRJnpREa/pcyO/e0Q/cFGBv6sLCk0Pmxzl1/0cHGLgOqCHhzXBEehhARDPB4Tf+tR53o1Ebg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=b1eM1pMf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="b1eM1pMf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A82ECC116D0; Wed, 25 Feb 2026 01:37:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1771983422; bh=4tqbIGQN7MIKsDrFeM3MNrHSPyj0b1KGetqKKpgbu+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b1eM1pMfYbdV5oEVBl4PGFKQ6x0NjecY2vwOu4qYRTSPjl4/hdkEof5zI7XSHMy+0 hbgBG/ITjMn5mTzNbGMWCh7LfDdGG7eTy1drUfCPy9uWCEpjxh+zQkno/nXd0VXX8M arGsW9O9mwyxZvUaJSALOauF47AUvyO2bdkNSAZg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Keguang Zhang , Brian Masney , Sasha Levin Subject: [PATCH 6.19 543/781] clk: loongson1: convert from divider_round_rate() to divider_determine_rate() Date: Tue, 24 Feb 2026 17:20:52 -0800 Message-ID: <20260225012413.113889278@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260225012359.695468795@linuxfoundation.org> References: <20260225012359.695468795@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Brian Masney [ Upstream commit 11d3c676e7e0f00e3398199f85e47a0e22369866 ] The divider_round_rate() function is now deprecated, so let's migrate to divider_determine_rate() instead so that this deprecated API can be removed. Note that when the main function itself was migrated to use determine_rate, this was mistakenly converted to: req->rate = divider_round_rate(...) This is invalid in the case when an error occurs since it can set the rate to a negative value. Fixes: bb40a2ef4fc9 ("clk: loongson1: convert from round_rate() to determine_rate()") Reviewed-by: Keguang Zhang Tested-by: Keguang Zhang # on LS1B & LS1C Signed-off-by: Brian Masney Signed-off-by: Sasha Levin --- drivers/clk/clk-loongson1.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/clk/clk-loongson1.c b/drivers/clk/clk-loongson1.c index f9f060d08a5fa..1674181a1107d 100644 --- a/drivers/clk/clk-loongson1.c +++ b/drivers/clk/clk-loongson1.c @@ -99,10 +99,7 @@ static int ls1x_divider_determine_rate(struct clk_hw *hw, struct ls1x_clk *ls1x_clk = to_ls1x_clk(hw); const struct ls1x_clk_div_data *d = ls1x_clk->data; - req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate, - d->table, d->width, d->flags); - - return 0; + return divider_determine_rate(hw, req, d->table, d->width, d->flags); } static int ls1x_divider_set_rate(struct clk_hw *hw, unsigned long rate, -- 2.51.0