diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-10-24 09:02:37 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-11-04 07:19:49 -0500 |
commit | 8433a509c0eb6bb1f33ce39c82c580b8901619ee (patch) | |
tree | f1554905dee5da4e840dfd674d5b004124496a22 /sound/isa/sb | |
parent | d78bec210f07b06f406b877b9179e0cc281ae8e6 (diff) |
[ALSA] Fix schedule_timeout usage
Use schedule_timeout_{,un}interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size. Also use
human-time conversion functions instead of hard-coded division to avoid
rounding issues.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/sb')
-rw-r--r-- | sound/isa/sb/emu8000.c | 9 | ||||
-rw-r--r-- | sound/isa/sb/emu8000_patch.c | 3 | ||||
-rw-r--r-- | sound/isa/sb/emu8000_pcm.c | 3 |
3 files changed, 5 insertions, 10 deletions
diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c index 95540f133199..b09c6575e01a 100644 --- a/sound/isa/sb/emu8000.c +++ b/sound/isa/sb/emu8000.c | |||
@@ -135,8 +135,7 @@ static void __init | |||
135 | snd_emu8000_read_wait(emu8000_t *emu) | 135 | snd_emu8000_read_wait(emu8000_t *emu) |
136 | { | 136 | { |
137 | while ((EMU8000_SMALR_READ(emu) & 0x80000000) != 0) { | 137 | while ((EMU8000_SMALR_READ(emu) & 0x80000000) != 0) { |
138 | set_current_state(TASK_INTERRUPTIBLE); | 138 | schedule_timeout_interruptible(1); |
139 | schedule_timeout(1); | ||
140 | if (signal_pending(current)) | 139 | if (signal_pending(current)) |
141 | break; | 140 | break; |
142 | } | 141 | } |
@@ -148,8 +147,7 @@ static void __init | |||
148 | snd_emu8000_write_wait(emu8000_t *emu) | 147 | snd_emu8000_write_wait(emu8000_t *emu) |
149 | { | 148 | { |
150 | while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { | 149 | while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { |
151 | set_current_state(TASK_INTERRUPTIBLE); | 150 | schedule_timeout_interruptible(1); |
152 | schedule_timeout(1); | ||
153 | if (signal_pending(current)) | 151 | if (signal_pending(current)) |
154 | break; | 152 | break; |
155 | } | 153 | } |
@@ -437,8 +435,7 @@ size_dram(emu8000_t *emu) | |||
437 | for (i = 0; i < 10000; i++) { | 435 | for (i = 0; i < 10000; i++) { |
438 | if ((EMU8000_SMALW_READ(emu) & 0x80000000) == 0) | 436 | if ((EMU8000_SMALW_READ(emu) & 0x80000000) == 0) |
439 | break; | 437 | break; |
440 | set_current_state(TASK_INTERRUPTIBLE); | 438 | schedule_timeout_interruptible(1); |
441 | schedule_timeout(1); | ||
442 | if (signal_pending(current)) | 439 | if (signal_pending(current)) |
443 | break; | 440 | break; |
444 | } | 441 | } |
diff --git a/sound/isa/sb/emu8000_patch.c b/sound/isa/sb/emu8000_patch.c index 26e693078cb3..2fea67e71c78 100644 --- a/sound/isa/sb/emu8000_patch.c +++ b/sound/isa/sb/emu8000_patch.c | |||
@@ -109,8 +109,7 @@ static void | |||
109 | snd_emu8000_write_wait(emu8000_t *emu) | 109 | snd_emu8000_write_wait(emu8000_t *emu) |
110 | { | 110 | { |
111 | while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { | 111 | while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { |
112 | set_current_state(TASK_INTERRUPTIBLE); | 112 | schedule_timeout_interruptible(1); |
113 | schedule_timeout(1); | ||
114 | if (signal_pending(current)) | 113 | if (signal_pending(current)) |
115 | break; | 114 | break; |
116 | } | 115 | } |
diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c index 0209790dc4b5..b323beeeda15 100644 --- a/sound/isa/sb/emu8000_pcm.c +++ b/sound/isa/sb/emu8000_pcm.c | |||
@@ -117,8 +117,7 @@ snd_emu8000_write_wait(emu8000_t *emu, int can_schedule) | |||
117 | { | 117 | { |
118 | while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { | 118 | while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { |
119 | if (can_schedule) { | 119 | if (can_schedule) { |
120 | set_current_state(TASK_INTERRUPTIBLE); | 120 | schedule_timeout_interruptible(1); |
121 | schedule_timeout(1); | ||
122 | if (signal_pending(current)) | 121 | if (signal_pending(current)) |
123 | break; | 122 | break; |
124 | } | 123 | } |