]> err.no Git - linux-2.6/blobdiff - sound/isa/sscape.c
Merge git://oak/home/sfr/kernels/iseries/work
[linux-2.6] / sound / isa / sscape.c
index 9f6b58c79209cbc4f217a0b9dd700bf0270e37b0..11588067fa4fe6218ea990a615eb74af7b85f6d1 100644 (file)
@@ -338,24 +338,10 @@ static inline void activate_ad1845_unsafe(unsigned io_base)
 static void soundscape_free(snd_card_t * c)
 {
        register struct soundscape *sscape = get_card_soundscape(c);
-       release_resource(sscape->io_res);
-       kfree_nocheck(sscape->io_res);
+       release_and_free_resource(sscape->io_res);
        free_dma(sscape->chip->dma1);
 }
 
-/*
- * Put this process into an idle wait-state for a certain number
- * of "jiffies". The process can almost certainly be rescheduled
- * while we're waiting, and so we must NOT be holding any spinlocks
- * when we call this function. If we are then we risk DEADLOCK in
- * SMP (Ha!) or pre-emptible kernels.
- */
-static inline void sleep(long jiffs, int state)
-{
-       set_current_state(state);
-       schedule_timeout(jiffs);
-}
-
 /*
  * Tell the SoundScape to begin a DMA tranfer using the given channel.
  * All locking issues are left to the caller.
@@ -393,7 +379,7 @@ static int obp_startup_ack(struct soundscape *s, unsigned timeout)
                unsigned long flags;
                unsigned char x;
 
-               sleep(1, TASK_INTERRUPTIBLE);
+               schedule_timeout_interruptible(1);
 
                spin_lock_irqsave(&s->lock, flags);
                x = inb(HOST_DATA_IO(s->io_base));
@@ -420,7 +406,7 @@ static int host_startup_ack(struct soundscape *s, unsigned timeout)
                unsigned long flags;
                unsigned char x;
 
-               sleep(1, TASK_INTERRUPTIBLE);
+               schedule_timeout_interruptible(1);
 
                spin_lock_irqsave(&s->lock, flags);
                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
        free_dma(params->dma1);
 
        _release_region:
-       release_resource(io_res);
-       kfree_nocheck(io_res);
+       release_and_free_resource(io_res);
 
        return err;
 }