clk: ti: divider: try to fix ti_clk_register_divider
authorArnd Bergmann <arnd@arndb.de>
Wed, 19 Apr 2017 17:44:55 +0000 (19:44 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Fri, 28 Apr 2017 18:07:09 +0000 (11:07 -0700)
commit3417f3528a2c7f8824cad7f0c35425961e98886b
tree4a4a1775d9ff11a1e6d8caaad7a60f14adc507d6
parentee7d74339df71015ae5b98d91393ea80b72a4546
clk: ti: divider: try to fix ti_clk_register_divider

Commit 6c0afb503937 ("clk: ti: convert to use proper register
definition for all accesses") converted all register accesses in
the TI clk driver to use a proper struct instead of a void
pointer casted struct that fits into a u32. Unfortunately, it
missed a conversion here in the didivder code, leading to a
compiler warning like so:

drivers/clk/ti/divider.c: In function 'ti_clk_register_divider':
drivers/clk/ti/divider.c:460:8: error: 'reg' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Treating a 'u32' variable as a structure leads to a stack
overflow here, and the register address we pass down is never
initialized. Convert this part of the code as well so things
work properly.

Fixes: 6c0afb503937 ("clk: ti: convert to use proper register definition for all accesses")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[sboyd@codeaurora.org: Fixed fixes tag, rewrote commit message,
s/reg_setup/reg/]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/ti/divider.c