diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/ch.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 7aad15436d24..92d1cb1b21cb 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c | |||
@@ -113,7 +113,7 @@ static const struct { | |||
113 | unsigned char asc; | 113 | unsigned char asc; |
114 | unsigned char ascq; | 114 | unsigned char ascq; |
115 | int errno; | 115 | int errno; |
116 | } err[] = { | 116 | } ch_err[] = { |
117 | /* Just filled in what looks right. Hav'nt checked any standard paper for | 117 | /* Just filled in what looks right. Hav'nt checked any standard paper for |
118 | these errno assignments, so they may be wrong... */ | 118 | these errno assignments, so they may be wrong... */ |
119 | { | 119 | { |
@@ -155,11 +155,11 @@ static int ch_find_errno(struct scsi_sense_hdr *sshdr) | |||
155 | /* Check to see if additional sense information is available */ | 155 | /* Check to see if additional sense information is available */ |
156 | if (scsi_sense_valid(sshdr) && | 156 | if (scsi_sense_valid(sshdr) && |
157 | sshdr->asc != 0) { | 157 | sshdr->asc != 0) { |
158 | for (i = 0; err[i].errno != 0; i++) { | 158 | for (i = 0; ch_err[i].errno != 0; i++) { |
159 | if (err[i].sense == sshdr->sense_key && | 159 | if (ch_err[i].sense == sshdr->sense_key && |
160 | err[i].asc == sshdr->asc && | 160 | ch_err[i].asc == sshdr->asc && |
161 | err[i].ascq == sshdr->ascq) { | 161 | ch_err[i].ascq == sshdr->ascq) { |
162 | errno = -err[i].errno; | 162 | errno = -ch_err[i].errno; |
163 | break; | 163 | break; |
164 | } | 164 | } |
165 | } | 165 | } |
@@ -721,8 +721,8 @@ static long ch_ioctl(struct file *file, | |||
721 | case CHIOGELEM: | 721 | case CHIOGELEM: |
722 | { | 722 | { |
723 | struct changer_get_element cge; | 723 | struct changer_get_element cge; |
724 | u_char cmd[12]; | 724 | u_char ch_cmd[12]; |
725 | u_char *buffer; | 725 | u_char *buffer; |
726 | unsigned int elem; | 726 | unsigned int elem; |
727 | int result,i; | 727 | int result,i; |
728 | 728 | ||
@@ -739,17 +739,18 @@ static long ch_ioctl(struct file *file, | |||
739 | mutex_lock(&ch->lock); | 739 | mutex_lock(&ch->lock); |
740 | 740 | ||
741 | voltag_retry: | 741 | voltag_retry: |
742 | memset(cmd,0,sizeof(cmd)); | 742 | memset(ch_cmd, 0, sizeof(ch_cmd)); |
743 | cmd[0] = READ_ELEMENT_STATUS; | 743 | ch_cmd[0] = READ_ELEMENT_STATUS; |
744 | cmd[1] = (ch->device->lun << 5) | | 744 | ch_cmd[1] = (ch->device->lun << 5) | |
745 | (ch->voltags ? 0x10 : 0) | | 745 | (ch->voltags ? 0x10 : 0) | |
746 | ch_elem_to_typecode(ch,elem); | 746 | ch_elem_to_typecode(ch,elem); |
747 | cmd[2] = (elem >> 8) & 0xff; | 747 | ch_cmd[2] = (elem >> 8) & 0xff; |
748 | cmd[3] = elem & 0xff; | 748 | ch_cmd[3] = elem & 0xff; |
749 | cmd[5] = 1; | 749 | ch_cmd[5] = 1; |
750 | cmd[9] = 255; | 750 | ch_cmd[9] = 255; |
751 | 751 | ||
752 | if (0 == (result = ch_do_scsi(ch, cmd, buffer, 256, DMA_FROM_DEVICE))) { | 752 | result = ch_do_scsi(ch, ch_cmd, buffer, 256, DMA_FROM_DEVICE); |
753 | if (!result) { | ||
753 | cge.cge_status = buffer[18]; | 754 | cge.cge_status = buffer[18]; |
754 | cge.cge_flags = 0; | 755 | cge.cge_flags = 0; |
755 | if (buffer[18] & CESTATUS_EXCEPT) { | 756 | if (buffer[18] & CESTATUS_EXCEPT) { |