This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / macintosh / mediabay.c
index aa07197..12132c0 100644 (file)
@@ -435,7 +435,6 @@ int __pmac check_media_bay(struct device_node *which_bay, int what)
 #endif /* CONFIG_BLK_DEV_IDE */
        return -ENODEV;
 }
-EXPORT_SYMBOL(check_media_bay);
 
 int __pmac check_media_bay_by_base(unsigned long base, int what)
 {
@@ -687,13 +686,15 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_ma
 
        /* Force an immediate detect */
        set_mb_power(bay, 0);
-       msleep(MB_POWER_DELAY);
+       set_current_state(TASK_UNINTERRUPTIBLE);
+       schedule_timeout(MS_TO_HZ(MB_POWER_DELAY));
        bay->content_id = MB_NO;
        bay->last_value = bay->ops->content(bay);
        bay->value_count = MS_TO_HZ(MB_STABLE_DELAY);
        bay->state = mb_empty;
        do {
-               msleep(MB_POLL_DELAY);
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
                media_bay_step(i);
        } while((bay->state != mb_empty) &&
                (bay->state != mb_up));
@@ -718,7 +719,8 @@ static int __pmac media_bay_suspend(struct macio_dev *mdev, u32 state)
                bay->sleeping = 1;
                set_mb_power(bay, 0);
                up(&bay->lock);
-               msleep(MB_POLL_DELAY);
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
                mdev->ofdev.dev.power_state = state;
        }
        return 0;
@@ -738,7 +740,8 @@ static int __pmac media_bay_resume(struct macio_dev *mdev)
                /* Force MB power to 0 */
                down(&bay->lock);
                set_mb_power(bay, 0);
-               msleep(MB_POWER_DELAY);
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               schedule_timeout(MS_TO_HZ(MB_POWER_DELAY));
                if (bay->ops->content(bay) != bay->content_id) {
                        printk("mediabay%d: content changed during sleep...\n", bay->index);
                        up(&bay->lock);
@@ -752,7 +755,8 @@ static int __pmac media_bay_resume(struct macio_dev *mdev)
                bay->cd_retry = 0;
 #endif
                do {
-                       msleep(MB_POLL_DELAY);
+                       set_current_state(TASK_UNINTERRUPTIBLE);
+                       schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
                        media_bay_step(bay->index);
                } while((bay->state != mb_empty) &&
                        (bay->state != mb_up));