diff mbox series

[10/13] clk: imx: composite-8m: convert compute_dividers to void

Message ID 20230918-imx8mp-dtsi-v1-10-1d008b3237c0@skidata.com (mailing list archive)
State Not Applicable, archived
Headers show
Series imx8mp: first clock propagation attempt (for LVDS) | expand

Commit Message

Benjamin Bara Sept. 17, 2023, 10:40 p.m. UTC
From: Benjamin Bara <benjamin.bara@skidata.com>

As the current implementation cannot fail, drop the return value.

Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
---
 drivers/clk/imx/clk-composite-8m.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
diff mbox series

Patch

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,