aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/sscape.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/sscape.c')
-rw-r--r--sound/isa/sscape.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index 9f6b58c79209..11588067fa4f 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -338,25 +338,11 @@ static inline void activate_ad1845_unsafe(unsigned io_base)
338static void soundscape_free(snd_card_t * c) 338static void soundscape_free(snd_card_t * c)
339{ 339{
340 register struct soundscape *sscape = get_card_soundscape(c); 340 register struct soundscape *sscape = get_card_soundscape(c);
341 release_resource(sscape->io_res); 341 release_and_free_resource(sscape->io_res);
342 kfree_nocheck(sscape->io_res);
343 free_dma(sscape->chip->dma1); 342 free_dma(sscape->chip->dma1);
344} 343}
345 344
346/* 345/*
347 * Put this process into an idle wait-state for a certain number
348 * of "jiffies". The process can almost certainly be rescheduled
349 * while we're waiting, and so we must NOT be holding any spinlocks
350 * when we call this function. If we are then we risk DEADLOCK in
351 * SMP (Ha!) or pre-emptible kernels.
352 */
353static inline void sleep(long jiffs, int state)
354{
355 set_current_state(state);
356 schedule_timeout(jiffs);
357}
358
359/*
360 * Tell the SoundScape to begin a DMA tranfer using the given channel. 346 * Tell the SoundScape to begin a DMA tranfer using the given channel.
361 * All locking issues are left to the caller. 347 * All locking issues are left to the caller.
362 */ 348 */
@@ -393,7 +379,7 @@ static int obp_startup_ack(struct soundscape *s, unsigned timeout)
393 unsigned long flags; 379 unsigned long flags;
394 unsigned char x; 380 unsigned char x;
395 381
396 sleep(1, TASK_INTERRUPTIBLE); 382 schedule_timeout_interruptible(1);
397 383
398 spin_lock_irqsave(&s->lock, flags); 384 spin_lock_irqsave(&s->lock, flags);
399 x = inb(HOST_DATA_IO(s->io_base)); 385 x = inb(HOST_DATA_IO(s->io_base));
@@ -420,7 +406,7 @@ static int host_startup_ack(struct soundscape *s, unsigned timeout)
420 unsigned long flags; 406 unsigned long flags;
421 unsigned char x; 407 unsigned char x;
422 408
423 sleep(1, TASK_INTERRUPTIBLE); 409 schedule_timeout_interruptible(1);
424 410
425 spin_lock_irqsave(&s->lock, flags); 411 spin_lock_irqsave(&s->lock, flags);
426 x = inb(HOST_DATA_IO(s->io_base)); 412 x = inb(HOST_DATA_IO(s->io_base));
@@ -1288,8 +1274,7 @@ static int __devinit create_sscape(const struct params *params, snd_card_t **rca
1288 free_dma(params->dma1); 1274 free_dma(params->dma1);
1289 1275
1290 _release_region: 1276 _release_region:
1291 release_resource(io_res); 1277 release_and_free_resource(io_res);
1292 kfree_nocheck(io_res);
1293 1278
1294 return err; 1279 return err;
1295} 1280}