aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qlogicpti.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-27 21:37:58 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-29 05:13:12 -0400
commit7a715f46012f3552294154978aed59cba9804928 (patch)
tree9e7079ae4ad370b63ac6c8a4face573d6cf60533 /drivers/scsi/qlogicpti.c
parent5778002874de0fb7e3d8c4a0a4afb6b1a6297069 (diff)
sparc: Make SBUS DMA interfaces take struct device.
This is the first step in converting all the SBUS drivers over to generic dma_*(). Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi/qlogicpti.c')
-rw-r--r--drivers/scsi/qlogicpti.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index 4a1cf6377f6c..f010506af884 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -788,7 +788,7 @@ static int __devinit qpti_map_queues(struct qlogicpti *qpti)
788 struct sbus_dev *sdev = qpti->sdev; 788 struct sbus_dev *sdev = qpti->sdev;
789 789
790#define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN) 790#define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN)
791 qpti->res_cpu = sbus_alloc_consistent(sdev, 791 qpti->res_cpu = sbus_alloc_consistent(&sdev->ofdev.dev,
792 QSIZE(RES_QUEUE_LEN), 792 QSIZE(RES_QUEUE_LEN),
793 &qpti->res_dvma); 793 &qpti->res_dvma);
794 if (qpti->res_cpu == NULL || 794 if (qpti->res_cpu == NULL ||
@@ -797,12 +797,12 @@ static int __devinit qpti_map_queues(struct qlogicpti *qpti)
797 return -1; 797 return -1;
798 } 798 }
799 799
800 qpti->req_cpu = sbus_alloc_consistent(sdev, 800 qpti->req_cpu = sbus_alloc_consistent(&sdev->ofdev.dev,
801 QSIZE(QLOGICPTI_REQ_QUEUE_LEN), 801 QSIZE(QLOGICPTI_REQ_QUEUE_LEN),
802 &qpti->req_dvma); 802 &qpti->req_dvma);
803 if (qpti->req_cpu == NULL || 803 if (qpti->req_cpu == NULL ||
804 qpti->req_dvma == 0) { 804 qpti->req_dvma == 0) {
805 sbus_free_consistent(sdev, QSIZE(RES_QUEUE_LEN), 805 sbus_free_consistent(&sdev->ofdev.dev, QSIZE(RES_QUEUE_LEN),
806 qpti->res_cpu, qpti->res_dvma); 806 qpti->res_cpu, qpti->res_dvma);
807 printk("QPTI: Cannot map request queue.\n"); 807 printk("QPTI: Cannot map request queue.\n");
808 return -1; 808 return -1;
@@ -875,8 +875,9 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
875 int sg_count; 875 int sg_count;
876 876
877 sg = scsi_sglist(Cmnd); 877 sg = scsi_sglist(Cmnd);
878 sg_count = sbus_map_sg(qpti->sdev, sg, scsi_sg_count(Cmnd), 878 sg_count = sbus_map_sg(&qpti->sdev->ofdev.dev, sg,
879 Cmnd->sc_data_direction); 879 scsi_sg_count(Cmnd),
880 Cmnd->sc_data_direction);
880 881
881 ds = cmd->dataseg; 882 ds = cmd->dataseg;
882 cmd->segment_cnt = sg_count; 883 cmd->segment_cnt = sg_count;
@@ -1151,7 +1152,7 @@ static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
1151 Cmnd->result = DID_ERROR << 16; 1152 Cmnd->result = DID_ERROR << 16;
1152 1153
1153 if (scsi_bufflen(Cmnd)) 1154 if (scsi_bufflen(Cmnd))
1154 sbus_unmap_sg(qpti->sdev, 1155 sbus_unmap_sg(&qpti->sdev->ofdev.dev,
1155 scsi_sglist(Cmnd), scsi_sg_count(Cmnd), 1156 scsi_sglist(Cmnd), scsi_sg_count(Cmnd),
1156 Cmnd->sc_data_direction); 1157 Cmnd->sc_data_direction);
1157 1158
@@ -1356,10 +1357,10 @@ static int __devinit qpti_sbus_probe(struct of_device *dev, const struct of_devi
1356 1357
1357fail_unmap_queues: 1358fail_unmap_queues:
1358#define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN) 1359#define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN)
1359 sbus_free_consistent(qpti->sdev, 1360 sbus_free_consistent(&qpti->sdev->ofdev.dev,
1360 QSIZE(RES_QUEUE_LEN), 1361 QSIZE(RES_QUEUE_LEN),
1361 qpti->res_cpu, qpti->res_dvma); 1362 qpti->res_cpu, qpti->res_dvma);
1362 sbus_free_consistent(qpti->sdev, 1363 sbus_free_consistent(&qpti->sdev->ofdev.dev,
1363 QSIZE(QLOGICPTI_REQ_QUEUE_LEN), 1364 QSIZE(QLOGICPTI_REQ_QUEUE_LEN),
1364 qpti->req_cpu, qpti->req_dvma); 1365 qpti->req_cpu, qpti->req_dvma);
1365#undef QSIZE 1366#undef QSIZE
@@ -1394,10 +1395,10 @@ static int __devexit qpti_sbus_remove(struct of_device *dev)
1394 free_irq(qpti->irq, qpti); 1395 free_irq(qpti->irq, qpti);
1395 1396
1396#define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN) 1397#define QSIZE(entries) (((entries) + 1) * QUEUE_ENTRY_LEN)
1397 sbus_free_consistent(qpti->sdev, 1398 sbus_free_consistent(&qpti->sdev->ofdev.dev,
1398 QSIZE(RES_QUEUE_LEN), 1399 QSIZE(RES_QUEUE_LEN),
1399 qpti->res_cpu, qpti->res_dvma); 1400 qpti->res_cpu, qpti->res_dvma);
1400 sbus_free_consistent(qpti->sdev, 1401 sbus_free_consistent(&qpti->sdev->ofdev.dev,
1401 QSIZE(QLOGICPTI_REQ_QUEUE_LEN), 1402 QSIZE(QLOGICPTI_REQ_QUEUE_LEN),
1402 qpti->req_cpu, qpti->req_dvma); 1403 qpti->req_cpu, qpti->req_dvma);
1403#undef QSIZE 1404#undef QSIZE