aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r--drivers/ide/ide.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 1ec983b00511..d4a6b102a772 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -529,17 +529,20 @@ static int generic_ide_resume(struct device *dev)
529 return err; 529 return err;
530} 530}
531 531
532static void generic_drive_reset(ide_drive_t *drive) 532static int generic_drive_reset(ide_drive_t *drive)
533{ 533{
534 struct request *rq; 534 struct request *rq;
535 int ret = 0;
535 536
536 rq = blk_get_request(drive->queue, READ, __GFP_WAIT); 537 rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
537 rq->cmd_type = REQ_TYPE_SPECIAL; 538 rq->cmd_type = REQ_TYPE_SPECIAL;
538 rq->cmd_len = 1; 539 rq->cmd_len = 1;
539 rq->cmd[0] = REQ_DRIVE_RESET; 540 rq->cmd[0] = REQ_DRIVE_RESET;
540 rq->cmd_flags |= REQ_SOFTBARRIER; 541 rq->cmd_flags |= REQ_SOFTBARRIER;
541 blk_execute_rq(drive->queue, NULL, rq, 1); 542 if (blk_execute_rq(drive->queue, NULL, rq, 1))
543 ret = rq->errors;
542 blk_put_request(rq); 544 blk_put_request(rq);
545 return ret;
543} 546}
544 547
545int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device *bdev, 548int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device *bdev,
@@ -616,8 +619,7 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
616 if (!capable(CAP_SYS_ADMIN)) 619 if (!capable(CAP_SYS_ADMIN))
617 return -EACCES; 620 return -EACCES;
618 621
619 generic_drive_reset(drive); 622 return generic_drive_reset(drive);
620 return 0;
621 623
622 case HDIO_GET_BUSSTATE: 624 case HDIO_GET_BUSSTATE:
623 if (!capable(CAP_SYS_ADMIN)) 625 if (!capable(CAP_SYS_ADMIN))