aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/telephony/ixj.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-09-10 03:27:31 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 13:06:39 -0400
commit1e63bc7342c40f0f1dd83d80d368665bd06f4963 (patch)
treeb47bce901b973c195d480f4b8f2d52c6d8bcc98d /drivers/telephony/ixj.c
parent7b4ccf8db4c1dc343ad5d6ed19240bbc3b5f945f (diff)
[PATCH] telephony: fix-up schedule_timeout() usage
Use schedule_timeout_uninterruptible() instead of set_current_state()/schedule_timeout() to reduce kernel size. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/telephony/ixj.c')
-rw-r--r--drivers/telephony/ixj.c54
1 files changed, 18 insertions, 36 deletions
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
index 9585d48dc4fc..f6704688ee8c 100644
--- a/drivers/telephony/ixj.c
+++ b/drivers/telephony/ixj.c
@@ -2071,8 +2071,7 @@ static int ixj_ring(IXJ *j)
2071 j->flags.ringing = 0; 2071 j->flags.ringing = 0;
2072 return 1; 2072 return 1;
2073 } 2073 }
2074 set_current_state(TASK_INTERRUPTIBLE); 2074 schedule_timeout_interruptible(1);
2075 schedule_timeout(1);
2076 if (signal_pending(current)) 2075 if (signal_pending(current))
2077 break; 2076 break;
2078 } 2077 }
@@ -2086,8 +2085,7 @@ static int ixj_ring(IXJ *j)
2086 return 1; 2085 return 1;
2087 } 2086 }
2088 } 2087 }
2089 set_current_state(TASK_INTERRUPTIBLE); 2088 schedule_timeout_interruptible(1);
2090 schedule_timeout(1);
2091 if (signal_pending(current)) 2089 if (signal_pending(current))
2092 break; 2090 break;
2093 } 2091 }
@@ -2153,10 +2151,8 @@ static int ixj_release(struct inode *inode, struct file *file_p)
2153 * Set up locks to ensure that only one process is talking to the DSP at a time. 2151 * Set up locks to ensure that only one process is talking to the DSP at a time.
2154 * This is necessary to keep the DSP from locking up. 2152 * This is necessary to keep the DSP from locking up.
2155 */ 2153 */
2156 while(test_and_set_bit(board, (void *)&j->busyflags) != 0) { 2154 while(test_and_set_bit(board, (void *)&j->busyflags) != 0)
2157 set_current_state(TASK_INTERRUPTIBLE); 2155 schedule_timeout_interruptible(1);
2158 schedule_timeout(1);
2159 }
2160 if (ixjdebug & 0x0002) 2156 if (ixjdebug & 0x0002)
2161 printk(KERN_INFO "Closing board %d\n", NUM(inode)); 2157 printk(KERN_INFO "Closing board %d\n", NUM(inode));
2162 2158
@@ -3286,14 +3282,10 @@ static void ixj_write_cidcw(IXJ *j)
3286 ixj_play_tone(j, 23); 3282 ixj_play_tone(j, 23);
3287 3283
3288 clear_bit(j->board, &j->busyflags); 3284 clear_bit(j->board, &j->busyflags);
3289 while(j->tone_state) { 3285 while(j->tone_state)
3290 set_current_state(TASK_INTERRUPTIBLE); 3286 schedule_timeout_interruptible(1);
3291 schedule_timeout(1); 3287 while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0)
3292 } 3288 schedule_timeout_interruptible(1);
3293 while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) {
3294 set_current_state(TASK_INTERRUPTIBLE);
3295 schedule_timeout(1);
3296 }
3297 if(ixjdebug & 0x0200) { 3289 if(ixjdebug & 0x0200) {
3298 printk("IXJ cidcw phone%d first tone end at %ld\n", j->board, jiffies); 3290 printk("IXJ cidcw phone%d first tone end at %ld\n", j->board, jiffies);
3299 } 3291 }
@@ -3313,14 +3305,10 @@ static void ixj_write_cidcw(IXJ *j)
3313 ixj_play_tone(j, 24); 3305 ixj_play_tone(j, 24);
3314 3306
3315 clear_bit(j->board, &j->busyflags); 3307 clear_bit(j->board, &j->busyflags);
3316 while(j->tone_state) { 3308 while(j->tone_state)
3317 set_current_state(TASK_INTERRUPTIBLE); 3309 schedule_timeout_interruptible(1);
3318 schedule_timeout(1); 3310 while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0)
3319 } 3311 schedule_timeout_interruptible(1);
3320 while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) {
3321 set_current_state(TASK_INTERRUPTIBLE);
3322 schedule_timeout(1);
3323 }
3324 if(ixjdebug & 0x0200) { 3312 if(ixjdebug & 0x0200) {
3325 printk("IXJ cidcw phone%d sent second tone at %ld\n", j->board, jiffies); 3313 printk("IXJ cidcw phone%d sent second tone at %ld\n", j->board, jiffies);
3326 } 3314 }
@@ -3328,14 +3316,10 @@ static void ixj_write_cidcw(IXJ *j)
3328 j->cidcw_wait = jiffies + ((50 * hertz) / 100); 3316 j->cidcw_wait = jiffies + ((50 * hertz) / 100);
3329 3317
3330 clear_bit(j->board, &j->busyflags); 3318 clear_bit(j->board, &j->busyflags);
3331 while(!j->flags.cidcw_ack && time_before(jiffies, j->cidcw_wait)) { 3319 while(!j->flags.cidcw_ack && time_before(jiffies, j->cidcw_wait))
3332 set_current_state(TASK_INTERRUPTIBLE); 3320 schedule_timeout_interruptible(1);
3333 schedule_timeout(1); 3321 while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0)
3334 } 3322 schedule_timeout_interruptible(1);
3335 while(test_and_set_bit(j->board, (void *)&j->busyflags) != 0) {
3336 set_current_state(TASK_INTERRUPTIBLE);
3337 schedule_timeout(1);
3338 }
3339 j->cidcw_wait = 0; 3323 j->cidcw_wait = 0;
3340 if(!j->flags.cidcw_ack) { 3324 if(!j->flags.cidcw_ack) {
3341 if(ixjdebug & 0x0200) { 3325 if(ixjdebug & 0x0200) {
@@ -6110,10 +6094,8 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
6110 * Set up locks to ensure that only one process is talking to the DSP at a time. 6094 * Set up locks to ensure that only one process is talking to the DSP at a time.
6111 * This is necessary to keep the DSP from locking up. 6095 * This is necessary to keep the DSP from locking up.
6112 */ 6096 */
6113 while(test_and_set_bit(board, (void *)&j->busyflags) != 0) { 6097 while(test_and_set_bit(board, (void *)&j->busyflags) != 0)
6114 set_current_state(TASK_INTERRUPTIBLE); 6098 schedule_timeout_interruptible(1);
6115 schedule_timeout(1);
6116 }
6117 if (ixjdebug & 0x0040) 6099 if (ixjdebug & 0x0040)
6118 printk("phone%d ioctl, cmd: 0x%x, arg: 0x%lx\n", minor, cmd, arg); 6100 printk("phone%d ioctl, cmd: 0x%x, arg: 0x%lx\n", minor, cmd, arg);
6119 if (minor >= IXJMAX) { 6101 if (minor >= IXJMAX) {