diff options
author | Christoph Hellwig <hch@lst.de> | 2014-10-11 10:00:33 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 05:16:12 -0500 |
commit | 2b3b3d61e8517b34432d1c73242b6345c9a15ebe (patch) | |
tree | 0d26ce8074033e49b44a03cb8e052b604e90608c /drivers/scsi/osst.c | |
parent | dccfa688ca7ffba0996bd5d9cd0e01b01002748e (diff) |
osst: 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/osst.c')
-rw-r--r-- | drivers/scsi/osst.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index b6d63d636692..8c384648eef9 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c | |||
@@ -3327,19 +3327,18 @@ static int osst_write_frame(struct osst_tape * STp, struct osst_request ** aSRpn | |||
3327 | /* Lock or unlock the drive door. Don't use when struct osst_request allocated. */ | 3327 | /* Lock or unlock the drive door. Don't use when struct osst_request allocated. */ |
3328 | static int do_door_lock(struct osst_tape * STp, int do_lock) | 3328 | static int do_door_lock(struct osst_tape * STp, int do_lock) |
3329 | { | 3329 | { |
3330 | int retval, cmd; | 3330 | int retval; |
3331 | 3331 | ||
3332 | cmd = do_lock ? SCSI_IOCTL_DOORLOCK : SCSI_IOCTL_DOORUNLOCK; | ||
3333 | #if DEBUG | 3332 | #if DEBUG |
3334 | printk(OSST_DEB_MSG "%s:D: %socking drive door.\n", tape_name(STp), do_lock ? "L" : "Unl"); | 3333 | printk(OSST_DEB_MSG "%s:D: %socking drive door.\n", tape_name(STp), do_lock ? "L" : "Unl"); |
3335 | #endif | 3334 | #endif |
3336 | retval = scsi_ioctl(STp->device, cmd, NULL); | 3335 | |
3337 | if (!retval) { | 3336 | retval = scsi_set_medium_removal(STp->device, |
3337 | do_lock ? SCSI_REMOVAL_PREVENT : SCSI_REMOVAL_ALLOW); | ||
3338 | if (!retval) | ||
3338 | STp->door_locked = do_lock ? ST_LOCKED_EXPLICIT : ST_UNLOCKED; | 3339 | STp->door_locked = do_lock ? ST_LOCKED_EXPLICIT : ST_UNLOCKED; |
3339 | } | 3340 | else |
3340 | else { | ||
3341 | STp->door_locked = ST_LOCK_FAILS; | 3341 | STp->door_locked = ST_LOCK_FAILS; |
3342 | } | ||
3343 | return retval; | 3342 | return retval; |
3344 | } | 3343 | } |
3345 | 3344 | ||