aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/osst.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/osst.c')
-rw-r--r--drivers/scsi/osst.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index 08060fb478b6..331b789937c4 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -3298,7 +3298,7 @@ static ssize_t osst_write(struct file * filp, const char __user * buf, size_t co
3298 char * name = tape_name(STp); 3298 char * name = tape_name(STp);
3299 3299
3300 3300
3301 if (down_interruptible(&STp->lock)) 3301 if (mutex_lock_interruptible(&STp->lock))
3302 return (-ERESTARTSYS); 3302 return (-ERESTARTSYS);
3303 3303
3304 /* 3304 /*
@@ -3600,7 +3600,7 @@ if (SRpnt) printk(KERN_ERR "%s:A: Not supposed to have SRpnt at line %d\n", name
3600out: 3600out:
3601 if (SRpnt != NULL) osst_release_request(SRpnt); 3601 if (SRpnt != NULL) osst_release_request(SRpnt);
3602 3602
3603 up(&STp->lock); 3603 mutex_unlock(&STp->lock);
3604 3604
3605 return retval; 3605 return retval;
3606} 3606}
@@ -3619,7 +3619,7 @@ static ssize_t osst_read(struct file * filp, char __user * buf, size_t count, lo
3619 char * name = tape_name(STp); 3619 char * name = tape_name(STp);
3620 3620
3621 3621
3622 if (down_interruptible(&STp->lock)) 3622 if (mutex_lock_interruptible(&STp->lock))
3623 return (-ERESTARTSYS); 3623 return (-ERESTARTSYS);
3624 3624
3625 /* 3625 /*
@@ -3785,7 +3785,7 @@ static ssize_t osst_read(struct file * filp, char __user * buf, size_t count, lo
3785out: 3785out:
3786 if (SRpnt != NULL) osst_release_request(SRpnt); 3786 if (SRpnt != NULL) osst_release_request(SRpnt);
3787 3787
3788 up(&STp->lock); 3788 mutex_unlock(&STp->lock);
3789 3789
3790 return retval; 3790 return retval;
3791} 3791}
@@ -4852,7 +4852,7 @@ static int osst_ioctl(struct inode * inode,struct file * file,
4852 char * name = tape_name(STp); 4852 char * name = tape_name(STp);
4853 void __user * p = (void __user *)arg; 4853 void __user * p = (void __user *)arg;
4854 4854
4855 if (down_interruptible(&STp->lock)) 4855 if (mutex_lock_interruptible(&STp->lock))
4856 return -ERESTARTSYS; 4856 return -ERESTARTSYS;
4857 4857
4858#if DEBUG 4858#if DEBUG
@@ -5163,14 +5163,14 @@ static int osst_ioctl(struct inode * inode,struct file * file,
5163 } 5163 }
5164 if (SRpnt) osst_release_request(SRpnt); 5164 if (SRpnt) osst_release_request(SRpnt);
5165 5165
5166 up(&STp->lock); 5166 mutex_unlock(&STp->lock);
5167 5167
5168 return scsi_ioctl(STp->device, cmd_in, p); 5168 return scsi_ioctl(STp->device, cmd_in, p);
5169 5169
5170out: 5170out:
5171 if (SRpnt) osst_release_request(SRpnt); 5171 if (SRpnt) osst_release_request(SRpnt);
5172 5172
5173 up(&STp->lock); 5173 mutex_unlock(&STp->lock);
5174 5174
5175 return retval; 5175 return retval;
5176} 5176}
@@ -5778,13 +5778,12 @@ static int osst_probe(struct device *dev)
5778 dev_num = i; 5778 dev_num = i;
5779 5779
5780 /* allocate a struct osst_tape for this device */ 5780 /* allocate a struct osst_tape for this device */
5781 tpnt = kmalloc(sizeof(struct osst_tape), GFP_ATOMIC); 5781 tpnt = kzalloc(sizeof(struct osst_tape), GFP_ATOMIC);
5782 if (tpnt == NULL) { 5782 if (!tpnt) {
5783 write_unlock(&os_scsi_tapes_lock); 5783 write_unlock(&os_scsi_tapes_lock);
5784 printk(KERN_ERR "osst :E: Can't allocate device descriptor, device not attached.\n"); 5784 printk(KERN_ERR "osst :E: Can't allocate device descriptor, device not attached.\n");
5785 goto out_put_disk; 5785 goto out_put_disk;
5786 } 5786 }
5787 memset(tpnt, 0, sizeof(struct osst_tape));
5788 5787
5789 /* allocate a buffer for this device */ 5788 /* allocate a buffer for this device */
5790 i = SDp->host->sg_tablesize; 5789 i = SDp->host->sg_tablesize;
@@ -5866,7 +5865,7 @@ static int osst_probe(struct device *dev)
5866 tpnt->modes[2].defined = 1; 5865 tpnt->modes[2].defined = 1;
5867 tpnt->density_changed = tpnt->compression_changed = tpnt->blksize_changed = 0; 5866 tpnt->density_changed = tpnt->compression_changed = tpnt->blksize_changed = 0;
5868 5867
5869 init_MUTEX(&tpnt->lock); 5868 mutex_init(&tpnt->lock);
5870 osst_nr_dev++; 5869 osst_nr_dev++;
5871 write_unlock(&os_scsi_tapes_lock); 5870 write_unlock(&os_scsi_tapes_lock);
5872 5871