diff options
author | Christoph Hellwig <hch@lst.de> | 2014-10-11 09:59:39 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 05:16:12 -0500 |
commit | dccfa688ca7ffba0996bd5d9cd0e01b01002748e (patch) | |
tree | 0e282329f243396e4ddfcea6567800934c3a02b2 /drivers/scsi/st.c | |
parent | 21a9d4c9d6c6bb22dffad67cb82f0037859262b7 (diff) |
st: call scsi_set_medium_removal directly
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r-- | drivers/scsi/st.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 7d2e036c75c1..e46e02b24ba4 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -861,17 +861,16 @@ static int set_mode_densblk(struct scsi_tape * STp, struct st_modedef * STm) | |||
861 | /* Lock or unlock the drive door. Don't use when st_request allocated. */ | 861 | /* Lock or unlock the drive door. Don't use when st_request allocated. */ |
862 | static int do_door_lock(struct scsi_tape * STp, int do_lock) | 862 | static int do_door_lock(struct scsi_tape * STp, int do_lock) |
863 | { | 863 | { |
864 | int retval, cmd; | 864 | int retval; |
865 | 865 | ||
866 | cmd = do_lock ? SCSI_IOCTL_DOORLOCK : SCSI_IOCTL_DOORUNLOCK; | ||
867 | DEBC_printk(STp, "%socking drive door.\n", do_lock ? "L" : "Unl"); | 866 | DEBC_printk(STp, "%socking drive door.\n", do_lock ? "L" : "Unl"); |
868 | retval = scsi_ioctl(STp->device, cmd, NULL); | 867 | |
869 | if (!retval) { | 868 | retval = scsi_set_medium_removal(STp->device, |
869 | do_lock ? SCSI_REMOVAL_PREVENT : SCSI_REMOVAL_ALLOW); | ||
870 | if (!retval) | ||
870 | STp->door_locked = do_lock ? ST_LOCKED_EXPLICIT : ST_UNLOCKED; | 871 | STp->door_locked = do_lock ? ST_LOCKED_EXPLICIT : ST_UNLOCKED; |
871 | } | 872 | else |
872 | else { | ||
873 | STp->door_locked = ST_LOCK_FAILS; | 873 | STp->door_locked = ST_LOCK_FAILS; |
874 | } | ||
875 | return retval; | 874 | return retval; |
876 | } | 875 | } |
877 | 876 | ||