aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/rtctimer.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-10-12 11:12:31 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:18:43 -0500
commitde24214d0c8e78134875752619f99b9e5824c196 (patch)
tree147f8cdcf5dfb3be2d95409f7ac44af101d2e0a5 /sound/core/rtctimer.c
parent2fd43d1159d22395aae01836c4b13ee5265a9b6b (diff)
[ALSA] timers: add module refcounting for global timers
Modules: RTC timer driver,Timer Midlevel Add a module pointer to the timer structure and use it for refcounting instead of the card's module pointer to prevent the global timer modules (rtctimer and hpetimer) from being removed while in use. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/core/rtctimer.c')
-rw-r--r--sound/core/rtctimer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/core/rtctimer.c b/sound/core/rtctimer.c
index 8762ff8938c2..c3c18568207e 100644
--- a/sound/core/rtctimer.c
+++ b/sound/core/rtctimer.c
@@ -124,7 +124,8 @@ static int __init rtctimer_init(void)
124 124
125 if (rtctimer_freq < 2 || rtctimer_freq > 8192 || 125 if (rtctimer_freq < 2 || rtctimer_freq > 8192 ||
126 (rtctimer_freq & (rtctimer_freq - 1)) != 0) { 126 (rtctimer_freq & (rtctimer_freq - 1)) != 0) {
127 snd_printk(KERN_ERR "rtctimer: invalid frequency %d\n", rtctimer_freq); 127 snd_printk(KERN_ERR "rtctimer: invalid frequency %d\n",
128 rtctimer_freq);
128 return -EINVAL; 129 return -EINVAL;
129 } 130 }
130 131
@@ -133,6 +134,7 @@ static int __init rtctimer_init(void)
133 if (err < 0) 134 if (err < 0)
134 return err; 135 return err;
135 136
137 timer->module = THIS_MODULE;
136 strcpy(timer->name, "RTC timer"); 138 strcpy(timer->name, "RTC timer");
137 timer->hw = rtc_hw; 139 timer->hw = rtc_hw;
138 timer->hw.resolution = NANO_SEC / rtctimer_freq; 140 timer->hw.resolution = NANO_SEC / rtctimer_freq;