if (rtctimer_freq < 2 || rtctimer_freq > 8192 ||
(rtctimer_freq & (rtctimer_freq - 1)) != 0) {
- snd_printk(KERN_ERR "rtctimer: invalid frequency %d\n", rtctimer_freq);
+ snd_printk(KERN_ERR "rtctimer: invalid frequency %d\n",
+ rtctimer_freq);
return -EINVAL;
}
if (err < 0)
return err;
+ timer->module = THIS_MODULE;
strcpy(timer->name, "RTC timer");
timer->hw = rtc_hw;
timer->hw.resolution = NANO_SEC / rtctimer_freq;
INIT_LIST_HEAD(&timeri->slave_active_head);
timeri->timer = timer;
- if (timer && timer->card && !try_module_get(timer->card->module)) {
+ if (timer && !try_module_get(timer->module)) {
kfree(timeri->owner);
kfree(timeri);
return NULL;
timeri->private_free(timeri);
kfree(timeri->owner);
kfree(timeri);
- if (timer && timer->card)
- module_put(timer->card->module);
+ if (timer)
+ module_put(timer->module);
return 0;
}
spin_lock_init(&timer->lock);
tasklet_init(&timer->task_queue, snd_timer_tasklet, (unsigned long)timer);
if (card != NULL) {
+ timer->module = card->module;
if ((err = snd_device_new(card, SNDRV_DEV_TIMER, timer, &ops)) < 0) {
snd_timer_free(timer);
return err;