From: Kai Makisara Date: Thu, 5 Oct 2006 19:59:46 +0000 (+0300) Subject: [SCSI] st: Fixup -ENOMEDIUM X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=413f73272090a69e35a03c938272ec661b1d3d4c;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [SCSI] st: Fixup -ENOMEDIUM Based on the original patch from Hannes Reinecke Fix st_open() to return -ENOMEDIUM instead of -EIO if no medium is found. Signed-off-by: Kai Makisara Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 3babdc76b3fb..e1a52c525ed4 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -1177,7 +1177,10 @@ static int st_open(struct inode *inode, struct file *filp) goto err_out; if ((filp->f_flags & O_NONBLOCK) == 0 && retval != CHKRES_READY) { - retval = (-EIO); + if (STp->ready == NO_TAPE) + retval = (-ENOMEDIUM); + else + retval = (-EIO); goto err_out; } return 0;