pata_cmd640: implement sff_irq_check() method

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by Sergei Shtylyov and committed by Jeff Garzik c1ce90f2 4bb969db

+12
+12
drivers/ata/pata_cmd640.c
··· 161 161 return 0; 162 162 } 163 163 164 + static bool cmd640_sff_irq_check(struct ata_port *ap) 165 + { 166 + struct pci_dev *pdev = to_pci_dev(ap->host->dev); 167 + int irq_reg = ap->port_no ? ARTIM23 : CFR; 168 + u8 irq_stat, irq_mask = ap->port_no ? 0x10 : 0x04; 169 + 170 + pci_read_config_byte(pdev, irq_reg, &irq_stat); 171 + 172 + return irq_stat & irq_mask; 173 + } 174 + 164 175 static struct scsi_host_template cmd640_sht = { 165 176 ATA_PIO_SHT(DRV_NAME), 166 177 }; ··· 180 169 .inherits = &ata_sff_port_ops, 181 170 /* In theory xfer_noirq is not needed once we kill the prefetcher */ 182 171 .sff_data_xfer = ata_sff_data_xfer_noirq, 172 + .sff_irq_check = cmd640_sff_irq_check, 183 173 .qc_issue = cmd640_qc_issue, 184 174 .cable_detect = ata_cable_40wire, 185 175 .set_piomode = cmd640_set_piomode,