X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Foss%2Fsys_timer.c;h=107534477a2f4937fd0a308be70d9f10fb46016b;hb=refs%2Fremotes%2Fvserver;hp=459c1741a9deb94cefbe660884bf3f73c10362ef;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/sound/oss/sys_timer.c b/sound/oss/sys_timer.c index 459c1741a..107534477 100644 --- a/sound/oss/sys_timer.c +++ b/sound/oss/sys_timer.c @@ -1,5 +1,5 @@ /* - * sound/sys_timer.c + * sound/oss/sys_timer.c * * The default timer for the Level 2 sequencer interface * Uses the (1/HZ sec) timer of kernel. @@ -27,9 +27,8 @@ static volatile unsigned long next_event_time; static unsigned long prev_event_time; static void poll_def_tmr(unsigned long dummy); -static spinlock_t lock=SPIN_LOCK_UNLOCKED; - -static struct timer_list def_tmr = TIMER_INITIALIZER(poll_def_tmr, 0, 0); +static DEFINE_SPINLOCK(lock); +static DEFINE_TIMER(def_tmr, poll_def_tmr, 0, 0); static unsigned long tmr2ticks(int tmr_value) @@ -191,13 +190,14 @@ def_tmr_get_time(int dev) } /* same as sound_timer.c:timer_ioctl!? */ -static int def_tmr_ioctl(int dev, unsigned int cmd, caddr_t arg) +static int def_tmr_ioctl(int dev, unsigned int cmd, void __user *arg) { + int __user *p = arg; int val; switch (cmd) { case SNDCTL_TMR_SOURCE: - return __put_user(TMR_INTERNAL, (int *)arg); + return __put_user(TMR_INTERNAL, p); case SNDCTL_TMR_START: tmr_reset(); @@ -213,7 +213,7 @@ static int def_tmr_ioctl(int dev, unsigned int cmd, caddr_t arg) return 0; case SNDCTL_TMR_TIMEBASE: - if (__get_user(val, (int *)arg)) + if (__get_user(val, p)) return -EFAULT; if (val) { if (val < 1) @@ -222,10 +222,10 @@ static int def_tmr_ioctl(int dev, unsigned int cmd, caddr_t arg) val = 1000; curr_timebase = val; } - return __put_user(curr_timebase, (int *)arg); + return __put_user(curr_timebase, p); case SNDCTL_TMR_TEMPO: - if (__get_user(val, (int *)arg)) + if (__get_user(val, p)) return -EFAULT; if (val) { if (val < 8) @@ -238,18 +238,18 @@ static int def_tmr_ioctl(int dev, unsigned int cmd, caddr_t arg) curr_tempo = val; reprogram_timer(); } - return __put_user(curr_tempo, (int *)arg); + return __put_user(curr_tempo, p); case SNDCTL_SEQ_CTRLRATE: - if (__get_user(val, (int *)arg)) + if (__get_user(val, p)) return -EFAULT; if (val != 0) /* Can't change */ return -EINVAL; val = ((curr_tempo * curr_timebase) + 30) / 60; - return __put_user(val, (int *)arg); + return __put_user(val, p); case SNDCTL_SEQ_GETTIME: - return __put_user(curr_ticks, (int *)arg); + return __put_user(curr_ticks, p); case SNDCTL_TMR_METRONOME: /* NOP */