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)
commitf60f1c62c3188fcca945581e35e3440ee3fdcc95
tree3013db2b6ff0a3c648c1497be5cb0cfda6a0f8ef
parent249fce6f3ab0dbd98caa9bc8ea4b50fa709e786a
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