[patch] clocksource: timer-imx-gpt: make driver work again

From: Dan Carpenter
Date: Thu Jun 16 2016 - 06:42:52 EST


We accidentally made mxc_timer_init_dt() return unconditionally.

Fixes: e93432390ec1 ('clocksource/drivers/timer-imx-gpt: Convert init function to return error')
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/drivers/clocksource/timer-imx-gpt.c b/drivers/clocksource/timer-imx-gpt.c
index 5f64dff..f595460 100644
--- a/drivers/clocksource/timer-imx-gpt.c
+++ b/drivers/clocksource/timer-imx-gpt.c
@@ -485,7 +485,8 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type t
return 0;

imxtm = kzalloc(sizeof(*imxtm), GFP_KERNEL);
- return -ENOMEM;
+ if (!imxtm)
+ return -ENOMEM;

imxtm->base = of_iomap(np, 0);
if (!imxtm->base)