]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/ata/pdc_adma.c
libata: implement and use ata_noop_irq_clear()
[mirror_ubuntu-bionic-kernel.git] / drivers / ata / pdc_adma.c
index 199f7e150eb37822f556753f7b7902580926aa3b..bc2d12a2da30732fce765c1c83077f282b52e09d 100644 (file)
 #define DRV_VERSION    "1.0"
 
 /* macro to calculate base address for ATA regs */
-#define ADMA_ATA_REGS(base,port_no)    ((base) + ((port_no) * 0x40))
+#define ADMA_ATA_REGS(base, port_no)   ((base) + ((port_no) * 0x40))
 
 /* macro to calculate base address for ADMA regs */
-#define ADMA_REGS(base,port_no)                ((base) + 0x80 + ((port_no) * 0x20))
+#define ADMA_REGS(base, port_no)       ((base) + 0x80 + ((port_no) * 0x20))
 
 /* macro to obtain addresses from ata_port */
 #define ADMA_PORT_REGS(ap) \
@@ -128,7 +128,7 @@ struct adma_port_priv {
        adma_state_t            state;
 };
 
-static int adma_ata_init_one (struct pci_dev *pdev,
+static int adma_ata_init_one(struct pci_dev *pdev,
                                const struct pci_device_id *ent);
 static int adma_port_start(struct ata_port *ap);
 static void adma_host_stop(struct ata_host *host);
@@ -138,7 +138,6 @@ static unsigned int adma_qc_issue(struct ata_queued_cmd *qc);
 static int adma_check_atapi_dma(struct ata_queued_cmd *qc);
 static void adma_bmdma_stop(struct ata_queued_cmd *qc);
 static u8 adma_bmdma_status(struct ata_port *ap);
-static void adma_irq_clear(struct ata_port *ap);
 static void adma_freeze(struct ata_port *ap);
 static void adma_thaw(struct ata_port *ap);
 static void adma_error_handler(struct ata_port *ap);
@@ -174,7 +173,7 @@ static const struct ata_port_operations adma_ata_ops = {
        .freeze                 = adma_freeze,
        .thaw                   = adma_thaw,
        .error_handler          = adma_error_handler,
-       .irq_clear              = adma_irq_clear,
+       .irq_clear              = ata_noop_irq_clear,
        .irq_on                 = ata_irq_on,
        .port_start             = adma_port_start,
        .port_stop              = adma_port_stop,
@@ -223,11 +222,6 @@ static u8 adma_bmdma_status(struct ata_port *ap)
        return 0;
 }
 
-static void adma_irq_clear(struct ata_port *ap)
-{
-       /* nothing */
-}
-
 static void adma_reset_engine(struct ata_port *ap)
 {
        void __iomem *chan = ADMA_PORT_REGS(ap);
@@ -321,8 +315,9 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
        u8  *buf = pp->pkt, *last_buf = NULL;
        int i = (2 + buf[3]) * 8;
        u8 pFLAGS = pORD | ((qc->tf.flags & ATA_TFLAG_WRITE) ? pDIRO : 0);
+       unsigned int si;
 
-       ata_for_each_sg(sg, qc) {
+       for_each_sg(qc->sg, sg, qc->n_elem, si) {
                u32 addr;
                u32 len;
 
@@ -340,8 +335,8 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
                buf[i++] = 0;   /* pPKLW */
                buf[i++] = 0;   /* reserved */
 
-               *(__le32 *)(buf + i)
-                       (pFLAGS & pEND) ? 0 : cpu_to_le32(pp->pkt_dma + i + 4);
+               *(__le32 *)(buf + i) =
+                       (pFLAGS & pEND) ? 0 : cpu_to_le32(pp->pkt_dma + i + 4);
                i += 4;
 
                VPRINTK("PRD[%u] = (0x%lX, 0x%X)\n", i/4,
@@ -455,7 +450,7 @@ static unsigned int adma_qc_issue(struct ata_queued_cmd *qc)
                adma_packet_start(qc);
                return 0;
 
-       case ATA_PROT_ATAPI_DMA:
+       case ATAPI_PROT_DMA:
                BUG();
                break;
 
@@ -617,7 +612,7 @@ static int adma_port_start(struct ata_port *ap)
                return -ENOMEM;
        /* paranoia? */
        if ((pp->pkt_dma & 7) != 0) {
-               printk("bad alignment for pp->pkt_dma: %08x\n",
+               printk(KERN_ERR "bad alignment for pp->pkt_dma: %08x\n",
                                                (u32)pp->pkt_dma);
                return -ENOMEM;
        }