diff options
author | Vignesh R <vigneshr@ti.com> | 2016-07-22 08:25:49 +0300 |
---|---|---|
committer | Jagan Teki <jteki@openedev.com> | 2016-07-29 21:45:00 +0300 |
commit | c595a2853099657ac97ccc7154a03e4d759fb909 (patch) | |
tree | 7b7ffcf8c0fc5da7561b16091bf6fc28ae575163 /drivers/spi/ti_qspi.c | |
parent | 69eeefaa060a848cd6acd8c94d1c43c9022adf53 (diff) | |
download | u-boot-c595a2853099657ac97ccc7154a03e4d759fb909.tar.xz |
spi: ti_qspi: Fix compiler warning when DEBUG macro is set
clk_div is uninitialized at the beginning of ti_spi_set_speed(), move
debug() print after clk_div calculation to avoid compiler warning and to
have proper value of clk_div printed during debugging.
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Diffstat (limited to 'drivers/spi/ti_qspi.c')
-rw-r--r-- | drivers/spi/ti_qspi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c index a850aa26ec..56ae29a3ee 100644 --- a/drivers/spi/ti_qspi.c +++ b/drivers/spi/ti_qspi.c @@ -110,13 +110,13 @@ static void ti_spi_set_speed(struct ti_qspi_priv *priv, uint hz) { uint clk_div; - debug("ti_spi_set_speed: hz: %d, clock divider %d\n", hz, clk_div); - if (!hz) clk_div = 0; else clk_div = (QSPI_FCLK / hz) - 1; + debug("ti_spi_set_speed: hz: %d, clock divider %d\n", hz, clk_div); + /* disable SCLK */ writel(readl(&priv->base->clk_ctrl) & ~QSPI_CLK_EN, &priv->base->clk_ctrl); |