]> git.baikalelectronics.ru Git - kernel.git/commit
clk: imx: Add correct failure handling for clk based helpers
authorAbel Vesa <abel.vesa@nxp.com>
Wed, 11 Dec 2019 09:25:40 +0000 (11:25 +0200)
committerShawn Guo <shawnguo@kernel.org>
Wed, 11 Dec 2019 11:19:04 +0000 (19:19 +0800)
commit5a1f218c11f4fea44e8652b552e167c3f7e40177
tree3013db2b6ff0a3c648c1497be5cb0cfda6a0f8ef
parent942c08eb9c520e5dd4e679b9ff78baec1c3436ec
clk: imx: Add correct failure handling for clk based helpers

If the clk_hw based API returns an error, trying to return the clk from
hw will end up in a NULL pointer dereference. So adding the to_clk
checker and using it inside every clk based macro helper we handle that
case correctly.

This to_clk is also temporary and will go away along with the clk based
macro helpers once there is no user that need them anymore.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/clk/imx/clk.h