mtip32xx: Change HDIO_GET_IDENTITY to return stored data
authorAsai Thambi S P <asamymuthupa@micron.com>
Wed, 30 May 2012 01:41:47 +0000 (18:41 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 31 May 2012 06:36:55 +0000 (08:36 +0200)
For the ioctl command HDIO_GET_IDENTITY, return the stored copy of IDENTIFY
DATA instead of sending the command to the device - similar to libata.

Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/mtip32xx/mtip32xx.c

index 4b057a7..73d7caa 100644 (file)
@@ -2295,13 +2295,12 @@ static int mtip_hw_ioctl(struct driver_data *dd, unsigned int cmd,
 {
        switch (cmd) {
        case HDIO_GET_IDENTITY:
-               if (mtip_get_identify(dd->port, (void __user *) arg) < 0) {
-                       dev_warn(&dd->pdev->dev,
-                               "Unable to read identity\n");
-                       return -EIO;
-               }
-
+       {
+               if (copy_to_user((void __user *)arg, dd->port->identify,
+                                               sizeof(u16) * ATA_ID_WORDS))
+                       return -EFAULT;
                break;
+       }
        case HDIO_DRIVE_CMD:
        {
                u8 drive_command[4];