summaryrefslogtreecommitdiffstats
path: root/drivers/staging/csr/oska/timer.c
blob: 67d3423315f56d71fdd7914d9cf4186ccc0b41b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * OSKA Linux implementation -- timers.
 *
 * Copyright (C) 2007 Cambridge Silicon Radio Ltd.
 *
 * Refer to LICENSE.txt included with this source code for details on
 * the license terms.
 */
#include <linux/module.h>

#include "timer.h"

static void timer_func(unsigned long data)
{
    os_timer_t *timer = (os_timer_t *)data;

    timer->func(timer->arg);
}

void os_timer_init(os_timer_t *timer, os_timer_func_t func, void *arg)
{
    timer->func = func;
    timer->arg = arg;
    timer->timer.function = timer_func;
    timer->timer.data = (unsigned long)timer;
    init_timer(&timer->timer);
}
EXPORT_SYMBOL(os_timer_init);