diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 11:19:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 11:19:33 -0400 |
commit | df3d80f5a5c74168be42788364d13cf6c83c7b9c (patch) | |
tree | 892a964c2fd28d028f2fb7471e8543d3f4006a58 /drivers/scsi/osst.c | |
parent | 3d06f7a5f74a813cee817c4b30b5e6f0398da0be (diff) | |
parent | c8e91b0a8fc8493e3bf3efcb3c8f866e9453cf1c (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (207 commits)
[SCSI] gdth: fix CONFIG_ISA build failure
[SCSI] esp_scsi: remove __dev{init,exit}
[SCSI] gdth: !use_sg cleanup and use of scsi accessors
[SCSI] gdth: Move members from SCp to gdth_cmndinfo, stage 2
[SCSI] gdth: Setup proper per-command private data
[SCSI] gdth: Remove gdth_ctr_tab[]
[SCSI] gdth: switch to modern scsi host registration
[SCSI] gdth: gdth_interrupt() gdth_get_status() & gdth_wait() fixes
[SCSI] gdth: clean up host private data
[SCSI] gdth: Remove virt hosts
[SCSI] gdth: Reorder scsi_host_template intitializers
[SCSI] gdth: kill gdth_{read,write}[bwl] wrappers
[SCSI] gdth: Remove 2.4.x support, in-kernel changelog
[SCSI] gdth: split out pci probing
[SCSI] gdth: split out eisa probing
[SCSI] gdth: split out isa probing
gdth: Make one abuse of scsi_cmnd less obvious
[SCSI] NCR5380: Use scsi_eh API for REQUEST_SENSE invocation
[SCSI] usb storage: use scsi_eh API in REQUEST_SENSE execution
[SCSI] scsi_error: Refactoring scsi_error to facilitate in synchronous REQUEST_SENSE
...
Diffstat (limited to 'drivers/scsi/osst.c')
-rw-r--r-- | drivers/scsi/osst.c | 21 |
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 | |||
3600 | out: | 3600 | out: |
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 | |||
3785 | out: | 3785 | out: |
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 | ||
5170 | out: | 5170 | out: |
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 | ||