vserver 1.9.5.x5
[linux-2.6.git] / drivers / macintosh / adb.c
index 3d2357e..5855bbf 100644 (file)
@@ -120,7 +120,7 @@ static struct adb_handler {
  * called.
  */
 static DECLARE_MUTEX(adb_handler_sem);
-static rwlock_t adb_handler_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(adb_handler_lock);
 
 #if 0
 static void printADBreply(struct adb_request *req)
@@ -139,10 +139,9 @@ static void printADBreply(struct adb_request *req)
 static __inline__ void adb_wait_ms(unsigned int ms)
 {
        if (current->pid && adb_probe_task_pid &&
-         adb_probe_task_pid == current->pid) {
-               set_task_state(current, TASK_UNINTERRUPTIBLE);
-               schedule_timeout(1 + ms * HZ / 1000);
-       } else
+         adb_probe_task_pid == current->pid)
+               msleep(ms);
+       else
                mdelay(ms);
 }
 
@@ -561,7 +560,7 @@ adb_unregister(int index)
                        write_lock_irq(&adb_handler_lock);
                }
                ret = 0;
-               adb_handler[index].handler = 0;
+               adb_handler[index].handler = NULL;
        }
        write_unlock_irq(&adb_handler_lock);
        up(&adb_handler_sem);