/home/lenb/src/to-akpm branch 'acpi-2.6.12'
[powerpc.git] / drivers / net / slip.c
index 1911271..404ea42 100644 (file)
@@ -74,6 +74,7 @@
 #include <linux/rtnetlink.h>
 #include <linux/if_arp.h>
 #include <linux/if_slip.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 #include "slip.h"
 #ifdef CONFIG_INET
@@ -198,18 +199,12 @@ err_exit:
 static void
 sl_free_bufs(struct slip *sl)
 {
-       void * tmp;
-
        /* Free all SLIP frame buffers. */
-       tmp = xchg(&sl->rbuff, NULL);
-       kfree(tmp);
-       tmp = xchg(&sl->xbuff, NULL);
-       kfree(tmp);
+       kfree(xchg(&sl->rbuff, NULL));
+       kfree(xchg(&sl->xbuff, NULL));
 #ifdef SL_INCLUDE_CSLIP
-       tmp = xchg(&sl->cbuff, NULL);
-       kfree(tmp);
-       if ((tmp = xchg(&sl->slcomp, NULL)) != NULL)
-               slhc_free(tmp);
+       kfree(xchg(&sl->cbuff, NULL));
+       slhc_free(xchg(&sl->slcomp, NULL));
 #endif
 }
 
@@ -1389,10 +1384,8 @@ static void __exit slip_exit(void)
        /* First of all: check for active disciplines and hangup them.
         */
        do {
-               if (busy) {
-                       set_current_state(TASK_INTERRUPTIBLE);
-                       schedule_timeout(HZ / 10);
-               }
+               if (busy)
+                       msleep_interruptible(100);
 
                busy = 0;
                for (i = 0; i < slip_maxdev; i++) {