/* In case the rate change propagation to parent clocks is undesirable, this function is recursively called to find the parent to calculate the accurate frequency.  */
static int mtk_clk_find_parent_rate(struct clk *clk, int id, const struct driver *drv)
/* In case the rate change propagation to parent clocks is undesirable, this function is recursively called to find the parent to calculate the accurate frequency.  */
static int mtk_clk_find_parent_rate(struct clk *clk, int id, const struct driver *drv)
{
	struct clk parent = { .id = id, };
	if (drv) {
		struct udevice *dev;
		if (uclass_get_device_by_driver(UCLASS_CLK, drv, &dev))
			return -ENODEV;
		parent.dev = dev;
	} else {
		parent.dev = clk->dev;
	}
	return clk_get_rate(&parent);
}