diff options
Diffstat (limited to 'drivers/scsi/libsas/sas_ata.c')
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index ced2de32c511..5e573efcf0a7 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -382,7 +382,7 @@ int sas_ata_init_host_and_port(struct domain_device *found_dev, | |||
382 | struct ata_port *ap; | 382 | struct ata_port *ap; |
383 | 383 | ||
384 | ata_host_init(&found_dev->sata_dev.ata_host, | 384 | ata_host_init(&found_dev->sata_dev.ata_host, |
385 | &ha->pcidev->dev, | 385 | ha->dev, |
386 | sata_port_info.flags, | 386 | sata_port_info.flags, |
387 | &sas_sata_ops); | 387 | &sas_sata_ops); |
388 | ap = ata_sas_port_alloc(&found_dev->sata_dev.ata_host, | 388 | ap = ata_sas_port_alloc(&found_dev->sata_dev.ata_host, |
@@ -448,10 +448,10 @@ static void sas_disc_task_done(struct sas_task *task) | |||
448 | * @task: the task to be executed | 448 | * @task: the task to be executed |
449 | * @buffer: pointer to buffer to do I/O | 449 | * @buffer: pointer to buffer to do I/O |
450 | * @size: size of @buffer | 450 | * @size: size of @buffer |
451 | * @pci_dma_dir: PCI_DMA_... | 451 | * @dma_dir: DMA direction. DMA_xxx |
452 | */ | 452 | */ |
453 | static int sas_execute_task(struct sas_task *task, void *buffer, int size, | 453 | static int sas_execute_task(struct sas_task *task, void *buffer, int size, |
454 | int pci_dma_dir) | 454 | enum dma_data_direction dma_dir) |
455 | { | 455 | { |
456 | int res = 0; | 456 | int res = 0; |
457 | struct scatterlist *scatter = NULL; | 457 | struct scatterlist *scatter = NULL; |
@@ -461,7 +461,7 @@ static int sas_execute_task(struct sas_task *task, void *buffer, int size, | |||
461 | struct sas_internal *i = | 461 | struct sas_internal *i = |
462 | to_sas_internal(task->dev->port->ha->core.shost->transportt); | 462 | to_sas_internal(task->dev->port->ha->core.shost->transportt); |
463 | 463 | ||
464 | if (pci_dma_dir != PCI_DMA_NONE) { | 464 | if (dma_dir != DMA_NONE) { |
465 | scatter = kzalloc(sizeof(*scatter), GFP_KERNEL); | 465 | scatter = kzalloc(sizeof(*scatter), GFP_KERNEL); |
466 | if (!scatter) | 466 | if (!scatter) |
467 | goto out; | 467 | goto out; |
@@ -474,11 +474,11 @@ static int sas_execute_task(struct sas_task *task, void *buffer, int size, | |||
474 | task->scatter = scatter; | 474 | task->scatter = scatter; |
475 | task->num_scatter = num_scatter; | 475 | task->num_scatter = num_scatter; |
476 | task->total_xfer_len = size; | 476 | task->total_xfer_len = size; |
477 | task->data_dir = pci_dma_dir; | 477 | task->data_dir = dma_dir; |
478 | task->task_done = sas_disc_task_done; | 478 | task->task_done = sas_disc_task_done; |
479 | if (pci_dma_dir != PCI_DMA_NONE && | 479 | if (dma_dir != DMA_NONE && |
480 | sas_protocol_ata(task->task_proto)) { | 480 | sas_protocol_ata(task->task_proto)) { |
481 | task->num_scatter = pci_map_sg(task->dev->port->ha->pcidev, | 481 | task->num_scatter = dma_map_sg(task->dev->port->ha->dev, |
482 | task->scatter, | 482 | task->scatter, |
483 | task->num_scatter, | 483 | task->num_scatter, |
484 | task->data_dir); | 484 | task->data_dir); |
@@ -565,9 +565,9 @@ static int sas_execute_task(struct sas_task *task, void *buffer, int size, | |||
565 | } | 565 | } |
566 | } | 566 | } |
567 | ex_err: | 567 | ex_err: |
568 | if (pci_dma_dir != PCI_DMA_NONE) { | 568 | if (dma_dir != DMA_NONE) { |
569 | if (sas_protocol_ata(task->task_proto)) | 569 | if (sas_protocol_ata(task->task_proto)) |
570 | pci_unmap_sg(task->dev->port->ha->pcidev, | 570 | dma_unmap_sg(task->dev->port->ha->dev, |
571 | task->scatter, task->num_scatter, | 571 | task->scatter, task->num_scatter, |
572 | task->data_dir); | 572 | task->data_dir); |
573 | kfree(scatter); | 573 | kfree(scatter); |
@@ -628,11 +628,11 @@ static void sas_get_ata_command_set(struct domain_device *dev) | |||
628 | * @features: the features register | 628 | * @features: the features register |
629 | * @buffer: pointer to buffer to do I/O | 629 | * @buffer: pointer to buffer to do I/O |
630 | * @size: size of @buffer | 630 | * @size: size of @buffer |
631 | * @pci_dma_dir: PCI_DMA_... | 631 | * @dma_dir: DMA direction. DMA_xxx |
632 | */ | 632 | */ |
633 | static int sas_issue_ata_cmd(struct domain_device *dev, u8 command, | 633 | static int sas_issue_ata_cmd(struct domain_device *dev, u8 command, |
634 | u8 features, void *buffer, int size, | 634 | u8 features, void *buffer, int size, |
635 | int pci_dma_dir) | 635 | enum dma_data_direction dma_dir) |
636 | { | 636 | { |
637 | int res = 0; | 637 | int res = 0; |
638 | struct sas_task *task; | 638 | struct sas_task *task; |
@@ -652,7 +652,7 @@ static int sas_issue_ata_cmd(struct domain_device *dev, u8 command, | |||
652 | task->ata_task.fis.device = d2h_fis->device; | 652 | task->ata_task.fis.device = d2h_fis->device; |
653 | task->ata_task.retry_count = 1; | 653 | task->ata_task.retry_count = 1; |
654 | 654 | ||
655 | res = sas_execute_task(task, buffer, size, pci_dma_dir); | 655 | res = sas_execute_task(task, buffer, size, dma_dir); |
656 | 656 | ||
657 | sas_free_task(task); | 657 | sas_free_task(task); |
658 | out: | 658 | out: |
@@ -707,7 +707,7 @@ static int sas_discover_sata_dev(struct domain_device *dev) | |||
707 | } | 707 | } |
708 | 708 | ||
709 | res = sas_issue_ata_cmd(dev, command, 0, identify_x, 512, | 709 | res = sas_issue_ata_cmd(dev, command, 0, identify_x, 512, |
710 | PCI_DMA_FROMDEVICE); | 710 | DMA_FROM_DEVICE); |
711 | if (res) | 711 | if (res) |
712 | goto out_err; | 712 | goto out_err; |
713 | 713 | ||
@@ -720,13 +720,13 @@ static int sas_discover_sata_dev(struct domain_device *dev) | |||
720 | goto cont1; | 720 | goto cont1; |
721 | res = sas_issue_ata_cmd(dev, ATA_SET_FEATURES, | 721 | res = sas_issue_ata_cmd(dev, ATA_SET_FEATURES, |
722 | ATA_FEATURE_PUP_STBY_SPIN_UP, | 722 | ATA_FEATURE_PUP_STBY_SPIN_UP, |
723 | NULL, 0, PCI_DMA_NONE); | 723 | NULL, 0, DMA_NONE); |
724 | if (res) | 724 | if (res) |
725 | goto cont1; | 725 | goto cont1; |
726 | 726 | ||
727 | schedule_timeout_interruptible(5*HZ); /* More time? */ | 727 | schedule_timeout_interruptible(5*HZ); /* More time? */ |
728 | res = sas_issue_ata_cmd(dev, command, 0, identify_x, 512, | 728 | res = sas_issue_ata_cmd(dev, command, 0, identify_x, 512, |
729 | PCI_DMA_FROMDEVICE); | 729 | DMA_FROM_DEVICE); |
730 | if (res) | 730 | if (res) |
731 | goto out_err; | 731 | goto out_err; |
732 | } | 732 | } |