vserver 1.9.3
[linux-2.6.git] / drivers / cdrom / cdu31a.c
index 4b38349..09873fa 100644 (file)
@@ -729,8 +729,7 @@ static void restart_on_error(void)
                       res_reg[1]);
        }
 
-       current->state = TASK_INTERRUPTIBLE;
-       schedule_timeout(2 * HZ);
+       msleep(2000);
 
        sony_get_toc();
 }
@@ -960,8 +959,7 @@ retry_cd_operation:
        if (((result_buffer[0] & 0xf0) == 0x20)
            && (num_retries < MAX_CDU31A_RETRIES)) {
                num_retries++;
-               current->state = TASK_INTERRUPTIBLE;
-               schedule_timeout(HZ / 10);      /* Wait .1 seconds on retries */
+               msleep(100);
                goto retry_cd_operation;
        }
 
@@ -2595,11 +2593,10 @@ static int read_audio(struct cdrom_read_audio *ra)
                                                retval = -EIO;
                                                goto exit_read_audio;
                                        }
-                               } else if (copy_to_user((char *)(ra->buf +
+                               } else if (copy_to_user(ra->buf +
                                                               (CD_FRAMESIZE_RAW
-                                                               * cframe)),
-                                                       (char *)
-                                                              readahead_buffer,
+                                                               * cframe),
+                                                       readahead_buffer,
                                                        CD_FRAMESIZE_RAW)) {
                                        retval = -EFAULT;
                                        goto exit_read_audio;
@@ -2612,8 +2609,7 @@ static int read_audio(struct cdrom_read_audio *ra)
                                retval = -EIO;
                                goto exit_read_audio;
                        }
-               } else if (copy_to_user((char *)(ra->buf + (CD_FRAMESIZE_RAW *
-                                                           cframe)),
+               } else if (copy_to_user(ra->buf + (CD_FRAMESIZE_RAW * cframe),
                                        (char *)readahead_buffer,
                                        CD_FRAMESIZE_RAW)) {
                        retval = -EFAULT;
@@ -2945,6 +2941,7 @@ static int scd_audio_ioctl(struct cdrom_device_info *cdi,
 static int scd_dev_ioctl(struct cdrom_device_info *cdi,
                         unsigned int cmd, unsigned long arg)
 {
+       void __user *argp = (void __user *)arg;
        int i;
 
        switch (cmd) {
@@ -2959,7 +2956,7 @@ static int scd_dev_ioctl(struct cdrom_device_info *cdi,
                                return -EIO;
                        }
 
-                       if (copy_from_user(&ra, (char *) arg, sizeof(ra)))
+                       if (copy_from_user(&ra, argp, sizeof(ra)))
                                return -EFAULT;
 
                        if (ra.nframes == 0) {
@@ -3180,7 +3177,7 @@ static int scd_block_release(struct inode *inode, struct file *file)
 static int scd_block_ioctl(struct inode *inode, struct file *file,
                                unsigned cmd, unsigned long arg)
 {
-       return cdrom_ioctl(&scd_info, inode, cmd, arg);
+       return cdrom_ioctl(file, &scd_info, inode, cmd, arg);
 }
 
 static int scd_block_media_changed(struct gendisk *disk)