clk: scmi: Fix min and max rate when registering clocks with discrete rates
authorSudeep Holla <sudeep.holla@arm.com>
Thu, 9 Jul 2020 08:17:05 +0000 (09:17 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 13 Jul 2020 08:40:21 +0000 (09:40 +0100)
commitfcd2e0deae50bce48450f14c8fc5611b08d7438c
tree996e9b450bd53d36a6cda1f62a6235aed230c245
parentdccec73de91de04f2a62c877411ecbe368a775f7
clk: scmi: Fix min and max rate when registering clocks with discrete rates

Currently we are not initializing the scmi clock with discrete rates
correctly. We fetch the min_rate and max_rate value only for clocks with
ranges and ignore the ones with discrete rates. This will lead to wrong
initialization of rate range when clock supports discrete rate.

Fix this by using the first and the last rate in the sorted list of the
discrete clock rates while registering the clock.

Link: https://lore.kernel.org/r/20200709081705.46084-2-sudeep.holla@arm.com
Fixes: 6d6a1d82eaef7 ("clk: add support for clocks provided by SCMI")
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Reported-and-tested-by: Dien Pham <dien.pham.ry@renesas.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/clk/clk-scmi.c