aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/sata_promise.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index b5a2f4f25d19..030665ba76b7 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -139,7 +139,7 @@ struct pdc_port_priv {
139 139
140static int pdc_sata_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val); 140static int pdc_sata_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
141static int pdc_sata_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val); 141static int pdc_sata_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
142static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); 142static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
143static int pdc_common_port_start(struct ata_port *ap); 143static int pdc_common_port_start(struct ata_port *ap);
144static int pdc_sata_port_start(struct ata_port *ap); 144static int pdc_sata_port_start(struct ata_port *ap);
145static void pdc_qc_prep(struct ata_queued_cmd *qc); 145static void pdc_qc_prep(struct ata_queued_cmd *qc);
@@ -562,31 +562,25 @@ static void pdc_qc_prep(struct ata_queued_cmd *qc)
562 switch (qc->tf.protocol) { 562 switch (qc->tf.protocol) {
563 case ATA_PROT_DMA: 563 case ATA_PROT_DMA:
564 pdc_fill_sg(qc); 564 pdc_fill_sg(qc);
565 /* fall through */ 565 /*FALLTHROUGH*/
566
567 case ATA_PROT_NODATA: 566 case ATA_PROT_NODATA:
568 i = pdc_pkt_header(&qc->tf, qc->ap->prd_dma, 567 i = pdc_pkt_header(&qc->tf, qc->ap->prd_dma,
569 qc->dev->devno, pp->pkt); 568 qc->dev->devno, pp->pkt);
570
571 if (qc->tf.flags & ATA_TFLAG_LBA48) 569 if (qc->tf.flags & ATA_TFLAG_LBA48)
572 i = pdc_prep_lba48(&qc->tf, pp->pkt, i); 570 i = pdc_prep_lba48(&qc->tf, pp->pkt, i);
573 else 571 else
574 i = pdc_prep_lba28(&qc->tf, pp->pkt, i); 572 i = pdc_prep_lba28(&qc->tf, pp->pkt, i);
575
576 pdc_pkt_footer(&qc->tf, pp->pkt, i); 573 pdc_pkt_footer(&qc->tf, pp->pkt, i);
577 break; 574 break;
578
579 case ATAPI_PROT_PIO: 575 case ATAPI_PROT_PIO:
580 pdc_fill_sg(qc); 576 pdc_fill_sg(qc);
581 break; 577 break;
582
583 case ATAPI_PROT_DMA: 578 case ATAPI_PROT_DMA:
584 pdc_fill_sg(qc); 579 pdc_fill_sg(qc);
585 /*FALLTHROUGH*/ 580 /*FALLTHROUGH*/
586 case ATAPI_PROT_NODATA: 581 case ATAPI_PROT_NODATA:
587 pdc_atapi_pkt(qc); 582 pdc_atapi_pkt(qc);
588 break; 583 break;
589
590 default: 584 default:
591 break; 585 break;
592 } 586 }
@@ -616,7 +610,7 @@ static unsigned int pdc_sata_ata_port_to_ata_no(const struct ata_port *ap)
616 unsigned int nr_ports = pdc_sata_nr_ports(ap); 610 unsigned int nr_ports = pdc_sata_nr_ports(ap);
617 unsigned int i; 611 unsigned int i;
618 612
619 for(i = 0; i < nr_ports && host->ports[i] != ap; ++i) 613 for (i = 0; i < nr_ports && host->ports[i] != ap; ++i)
620 ; 614 ;
621 BUG_ON(i >= nr_ports); 615 BUG_ON(i >= nr_ports);
622 return pdc_port_no_to_ata_no(i, pdc_is_sataii_tx4(ap->flags)); 616 return pdc_port_no_to_ata_no(i, pdc_is_sataii_tx4(ap->flags));
@@ -748,8 +742,8 @@ static void pdc_error_intr(struct ata_port *ap, struct ata_queued_cmd *qc,
748 ata_port_abort(ap); 742 ata_port_abort(ap);
749} 743}
750 744
751static inline unsigned int pdc_host_intr(struct ata_port *ap, 745static unsigned int pdc_host_intr(struct ata_port *ap,
752 struct ata_queued_cmd *qc) 746 struct ata_queued_cmd *qc)
753{ 747{
754 unsigned int handled = 0; 748 unsigned int handled = 0;
755 void __iomem *ata_mmio = ap->ioaddr.cmd_addr; 749 void __iomem *ata_mmio = ap->ioaddr.cmd_addr;
@@ -775,7 +769,6 @@ static inline unsigned int pdc_host_intr(struct ata_port *ap,
775 ata_qc_complete(qc); 769 ata_qc_complete(qc);
776 handled = 1; 770 handled = 1;
777 break; 771 break;
778
779 default: 772 default:
780 ap->stats.idle_irq++; 773 ap->stats.idle_irq++;
781 break; 774 break;
@@ -832,7 +825,7 @@ static irqreturn_t pdc_interrupt(int irq, void *dev_instance)
832 goto done_irq; 825 goto done_irq;
833 } 826 }
834 827
835 mask &= 0xffff; /* only 16 tags possible */ 828 mask &= 0xffff; /* only 16 SEQIDs possible */
836 if (mask == 0 && hotplug_status == 0) { 829 if (mask == 0 && hotplug_status == 0) {
837 VPRINTK("QUICK EXIT 3\n"); 830 VPRINTK("QUICK EXIT 3\n");
838 goto done_irq; 831 goto done_irq;
@@ -879,7 +872,7 @@ done_irq:
879 return IRQ_RETVAL(handled); 872 return IRQ_RETVAL(handled);
880} 873}
881 874
882static inline void pdc_packet_start(struct ata_queued_cmd *qc) 875static void pdc_packet_start(struct ata_queued_cmd *qc)
883{ 876{
884 struct ata_port *ap = qc->ap; 877 struct ata_port *ap = qc->ap;
885 struct pdc_port_priv *pp = ap->private_data; 878 struct pdc_port_priv *pp = ap->private_data;
@@ -914,11 +907,9 @@ static unsigned int pdc_qc_issue(struct ata_queued_cmd *qc)
914 case ATA_PROT_DMA: 907 case ATA_PROT_DMA:
915 pdc_packet_start(qc); 908 pdc_packet_start(qc);
916 return 0; 909 return 0;
917
918 default: 910 default:
919 break; 911 break;
920 } 912 }
921
922 return ata_sff_qc_issue(qc); 913 return ata_sff_qc_issue(qc);
923} 914}
924 915