Source
297
297
298
298
to->flags = TIMER_OF_IRQ | TIMER_OF_CLOCK | TIMER_OF_BASE;
299
299
to->of_irq.handler = stm32_clock_event_handler;
300
300
301
301
ret = timer_of_init(node, to);
302
302
if (ret)
303
303
goto err;
304
304
305
305
to->private_data = kzalloc(sizeof(struct stm32_timer_private),
306
306
GFP_KERNEL);
307
-
if (!to->private_data)
307
+
if (!to->private_data) {
308
+
ret = -ENOMEM;
308
309
goto deinit;
310
+
}
309
311
310
312
rstc = of_reset_control_get(node, NULL);
311
313
if (!IS_ERR(rstc)) {
312
314
reset_control_assert(rstc);
313
315
reset_control_deassert(rstc);
314
316
}
315
317
316
318
stm32_timer_set_width(to);
317
319
318
320
stm32_timer_set_prescaler(to);