Skip to contentSkip to conversation

clk: ccf: replace the get_rate helper

PATCH New Dario Binacchi 2 participants 2 messages Oct 14, 2020 – Oct 23, 2020 Common clk

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clk: ccf: replace the get_rate helper

The 12d152620d commit fixed the get_rate helper because the set_parent one did not re-parent the clock device to the new parent. The 4d139f3838 commit allows you to remove this workaround by calling the clk_get_parent_rate routine.

---

Changes in v2:
- Replace clk_get_parent_rate with clk_generic_get_rate to avoid compilation warnings.

 drivers/clk/clk-mux.c | 26 +-------------------------
 1 file changed, 1 insertion(+), 25 deletions(-)
drivers/clk/clk-mux.c +1 -25
index 7a5ee7a45f..f1becd20d8 100644
@@ -150,32 +150,8 @@ static int clk_mux_set_parent(struct clk *clk, struct clk *parent)
 	return 0;
 }
 
-static ulong clk_mux_get_rate(struct clk *clk)
-{
-	struct clk_mux *mux = to_clk_mux(clk_dev_binded(clk) ?
-			dev_get_clk_ptr(clk->dev) : clk);
-	struct udevice *parent;
-	struct clk *pclk;
-	int err, index;
-
-	index = clk_mux_get_parent(clk);
-	if (index >= mux->num_parents)
-		return -EFAULT;
-
-	err = uclass_get_device_by_name(UCLASS_CLK, mux->parent_names[index],
-					&parent);
-	if (err)
-		return err;
-
-	pclk = dev_get_clk_ptr(parent);
-	if (!pclk)
-		return -ENODEV;
-
-	return clk_get_rate(pclk);
-}
-
 const struct clk_ops clk_mux_ops = {
-	.get_rate = clk_mux_get_rate,
+	.get_rate = clk_generic_get_rate,
 	.set_parent = clk_mux_set_parent,
 };
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 clk: ccf: replace the get_rate helper

Quoted 6 lines · Dario Binacchi

The 12d152620d commit fixed the get_rate helper because the set_parent one did not re-parent the clock device to the new parent. The 4d139f3838 commit allows you to remove this workaround by calling the clk_get_parent_rate routine.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201022/dabcd4e7/attachment.sig>