aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/esp.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-08-30 18:30:38 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-08-30 18:30:38 -0400
commit0a7d5f8ce960e74fa22986bda4af488539796e49 (patch)
treee29ad17808a5c3410518e22dae8dfe94801b59f3 /drivers/scsi/esp.c
parent0165508c80a2b5d5268d9c5dfa9b30c534a33693 (diff)
parentdc709bd190c130b299ac19d596594256265c042a (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/scsi/esp.c')
-rw-r--r--drivers/scsi/esp.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/scsi/esp.c b/drivers/scsi/esp.c
index 10573c24a50b..5630868c1b25 100644
--- a/drivers/scsi/esp.c
+++ b/drivers/scsi/esp.c
@@ -1146,7 +1146,7 @@ static struct sbus_dev sun4_esp_dev;
1146static int __init esp_sun4_probe(struct scsi_host_template *tpnt) 1146static int __init esp_sun4_probe(struct scsi_host_template *tpnt)
1147{ 1147{
1148 if (sun4_esp_physaddr) { 1148 if (sun4_esp_physaddr) {
1149 memset(&sun4_esp_dev, 0, sizeof(esp_dev)); 1149 memset(&sun4_esp_dev, 0, sizeof(sun4_esp_dev));
1150 sun4_esp_dev.reg_addrs[0].phys_addr = sun4_esp_physaddr; 1150 sun4_esp_dev.reg_addrs[0].phys_addr = sun4_esp_physaddr;
1151 sun4_esp_dev.irqs[0] = 4; 1151 sun4_esp_dev.irqs[0] = 4;
1152 sun4_esp_dev.resource[0].start = sun4_esp_physaddr; 1152 sun4_esp_dev.resource[0].start = sun4_esp_physaddr;
@@ -1162,6 +1162,7 @@ static int __init esp_sun4_probe(struct scsi_host_template *tpnt)
1162 1162
1163static int __devexit esp_sun4_remove(void) 1163static int __devexit esp_sun4_remove(void)
1164{ 1164{
1165 struct of_device *dev = &sun4_esp_dev.ofdev;
1165 struct esp *esp = dev_get_drvdata(&dev->dev); 1166 struct esp *esp = dev_get_drvdata(&dev->dev);
1166 1167
1167 return esp_remove_common(esp); 1168 return esp_remove_common(esp);
@@ -1397,7 +1398,7 @@ static void esp_get_dmabufs(struct esp *esp, struct scsi_cmnd *sp)
1397 sp->SCp.ptr = NULL; 1398 sp->SCp.ptr = NULL;
1398 } 1399 }
1399 } else { 1400 } else {
1400 sp->SCp.buffer = (struct scatterlist *) sp->buffer; 1401 sp->SCp.buffer = (struct scatterlist *) sp->request_buffer;
1401 sp->SCp.buffers_residual = sbus_map_sg(esp->sdev, 1402 sp->SCp.buffers_residual = sbus_map_sg(esp->sdev,
1402 sp->SCp.buffer, 1403 sp->SCp.buffer,
1403 sp->use_sg, 1404 sp->use_sg,
@@ -1410,7 +1411,7 @@ static void esp_get_dmabufs(struct esp *esp, struct scsi_cmnd *sp)
1410static void esp_release_dmabufs(struct esp *esp, struct scsi_cmnd *sp) 1411static void esp_release_dmabufs(struct esp *esp, struct scsi_cmnd *sp)
1411{ 1412{
1412 if (sp->use_sg) { 1413 if (sp->use_sg) {
1413 sbus_unmap_sg(esp->sdev, sp->buffer, sp->use_sg, 1414 sbus_unmap_sg(esp->sdev, sp->request_buffer, sp->use_sg,
1414 sp->sc_data_direction); 1415 sp->sc_data_direction);
1415 } else if (sp->request_bufflen) { 1416 } else if (sp->request_bufflen) {
1416 sbus_unmap_single(esp->sdev, 1417 sbus_unmap_single(esp->sdev,
@@ -2754,18 +2755,15 @@ static int esp_do_data_finale(struct esp *esp)
2754 */ 2755 */
2755static int esp_should_clear_sync(struct scsi_cmnd *sp) 2756static int esp_should_clear_sync(struct scsi_cmnd *sp)
2756{ 2757{
2757 u8 cmd1 = sp->cmnd[0]; 2758 u8 cmd = sp->cmnd[0];
2758 u8 cmd2 = sp->data_cmnd[0];
2759 2759
2760 /* These cases are for spinning up a disk and 2760 /* These cases are for spinning up a disk and
2761 * waiting for that spinup to complete. 2761 * waiting for that spinup to complete.
2762 */ 2762 */
2763 if (cmd1 == START_STOP || 2763 if (cmd == START_STOP)
2764 cmd2 == START_STOP)
2765 return 0; 2764 return 0;
2766 2765
2767 if (cmd1 == TEST_UNIT_READY || 2766 if (cmd == TEST_UNIT_READY)
2768 cmd2 == TEST_UNIT_READY)
2769 return 0; 2767 return 0;
2770 2768
2771 /* One more special case for SCSI tape drives, 2769 /* One more special case for SCSI tape drives,
@@ -2773,8 +2771,7 @@ static int esp_should_clear_sync(struct scsi_cmnd *sp)
2773 * completion of a rewind or tape load operation. 2771 * completion of a rewind or tape load operation.
2774 */ 2772 */
2775 if (sp->device->type == TYPE_TAPE) { 2773 if (sp->device->type == TYPE_TAPE) {
2776 if (cmd1 == MODE_SENSE || 2774 if (cmd == MODE_SENSE)
2777 cmd2 == MODE_SENSE)
2778 return 0; 2775 return 0;
2779 } 2776 }
2780 2777