From e6dfeb296d38ccd911b01fb3125590482aa6da23 Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Mon, 25 Nov 2019 20:04:28 +0800 Subject: [PATCH] Revert "clk: fractional-divider: check parent rate only if flag is set" This reverts commit d13501a2bedfbea0983cc868d3f1dc692627f60d. This patch causes 32768Hz can't be divided from 24MHz. Change-Id: I1e86c2b0c96be0d1a80de83d1ac5e5909becbde1 Signed-off-by: Finley Xiao Signed-off-by: Elaine Zhang --- drivers/clk/clk-fractional-divider.c | 2 +- include/linux/clk-provider.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c index 51edbc5e2406..2d7fdf1494a1 100644 --- a/drivers/clk/clk-fractional-divider.c +++ b/drivers/clk/clk-fractional-divider.c @@ -96,7 +96,7 @@ static long clk_fd_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long m, n; u64 ret; - if (!rate || (!clk_hw_can_set_rate_parent(hw) && rate >= *parent_rate)) + if (!rate && rate >= *parent_rate) return *parent_rate; if (fd->approximation) diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index b5d80b54b54a..723f298c359b 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -1119,9 +1119,6 @@ int clk_hw_set_parent(struct clk_hw *hw, struct clk_hw *new_parent); unsigned int __clk_get_enable_count(struct clk *clk); unsigned long clk_hw_get_rate(const struct clk_hw *hw); unsigned long clk_hw_get_flags(const struct clk_hw *hw); -#define clk_hw_can_set_rate_parent(hw) \ - (clk_hw_get_flags((hw)) & CLK_SET_RATE_PARENT) - bool clk_hw_is_prepared(const struct clk_hw *hw); bool clk_hw_rate_is_protected(const struct clk_hw *hw); bool clk_hw_is_enabled(const struct clk_hw *hw);