]> git.baikalelectronics.ru Git - kernel.git/commit
soc: qcom: geni: Don't ignore clk_round_rate() errors in geni_se_clk_tbl_get()
authorDouglas Anderson <dianders@chromium.org>
Thu, 6 Sep 2018 22:49:05 +0000 (15:49 -0700)
committerAndy Gross <andy.gross@linaro.org>
Thu, 13 Sep 2018 20:54:21 +0000 (15:54 -0500)
commit32d4f2e16de89fcc3a51b52a9b596d7eecadfaad
tree4acbc6b7556256a25b24cf2e70f25aee979821c4
parentb1923275e65112c7b01df47aa3454ea814d3f0e5
soc: qcom: geni: Don't ignore clk_round_rate() errors in geni_se_clk_tbl_get()

The function clk_round_rate() is defined to return a "long", not an
"unsigned long".  That's because it might return a negative error
code.  Change the call in geni_se_clk_tbl_get() to check for errors.

While we're at it, get rid of a useless init of "freq".

NOTE: overall the idea that we should iterate over clk_round_rate() to
try to reconstruct a table already present in the clock driver is
questionable.  Specifically:
- This method relies on "clk_round_rate()" rounding up.
- This method only works if the table is sorted and has no duplicates.
...this patch doesn't try to fix those problems, it just makes the
error handling more correct.

Fixes: d17f883d25ee ("soc: qcom: Add GENI based QUP Wrapper driver")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
drivers/soc/qcom/qcom-geni-se.c