aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-sff.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2010-05-07 14:49:02 -0400
committerJeff Garzik <jgarzik@redhat.com>2010-05-14 17:35:52 -0400
commite42a542ba9cca594897176020445023c54d903d6 (patch)
treeb2a136581d6fcea9a2a6c534888319b70e15c2af /drivers/ata/libata-sff.c
parent41dec29bcb05eb8ec396f70ce791c6e3e4ce4712 (diff)
libata: make sff_irq_on() method optional
Now, with the introduction of the sff_set_devctl() method, we can use it in sff_irq_on() method too -- that way its implementations in 'pata_bf54x' and 'pata_scc' become virtually identical to ata_sff_irq_on(). The sff_irq_on() method now becomes quite superfluous, and the only reason not to remove it completely is the existence of the 'pata_octeon_cf' driver which implements it as an empty function. Just make the method optional then, with ata_sff_irq_on() becoming generic taskfile-bound function, still global for the 'pata_bf54x' driver to be able to call it from its thaw() and postreset() methods. While at it, make the sff_irq_on() method and ata_sff_irq_on() return 'void' as the result is always ignored anyway. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r--drivers/ata/libata-sff.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 31b495fcd969..b7f7f8557fee 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -63,7 +63,6 @@ const struct ata_port_operations ata_sff_port_ops = {
63 .sff_tf_read = ata_sff_tf_read, 63 .sff_tf_read = ata_sff_tf_read,
64 .sff_exec_command = ata_sff_exec_command, 64 .sff_exec_command = ata_sff_exec_command,
65 .sff_data_xfer = ata_sff_data_xfer, 65 .sff_data_xfer = ata_sff_data_xfer,
66 .sff_irq_on = ata_sff_irq_on,
67 .sff_irq_clear = ata_sff_irq_clear, 66 .sff_irq_clear = ata_sff_irq_clear,
68 67
69 .lost_interrupt = ata_sff_lost_interrupt, 68 .lost_interrupt = ata_sff_lost_interrupt,
@@ -538,24 +537,29 @@ void ata_dev_select(struct ata_port *ap, unsigned int device,
538 * Enable interrupts on a legacy IDE device using MMIO or PIO, 537 * Enable interrupts on a legacy IDE device using MMIO or PIO,
539 * wait for idle, clear any pending interrupts. 538 * wait for idle, clear any pending interrupts.
540 * 539 *
540 * Note: may NOT be used as the sff_irq_on() entry in
541 * ata_port_operations.
542 *
541 * LOCKING: 543 * LOCKING:
542 * Inherited from caller. 544 * Inherited from caller.
543 */ 545 */
544u8 ata_sff_irq_on(struct ata_port *ap) 546void ata_sff_irq_on(struct ata_port *ap)
545{ 547{
546 struct ata_ioports *ioaddr = &ap->ioaddr; 548 struct ata_ioports *ioaddr = &ap->ioaddr;
547 u8 tmp; 549
550 if (ap->ops->sff_irq_on) {
551 ap->ops->sff_irq_on(ap);
552 return;
553 }
548 554
549 ap->ctl &= ~ATA_NIEN; 555 ap->ctl &= ~ATA_NIEN;
550 ap->last_ctl = ap->ctl; 556 ap->last_ctl = ap->ctl;
551 557
552 if (ioaddr->ctl_addr) 558 if (ap->ops->sff_set_devctl || ioaddr->ctl_addr)
553 iowrite8(ap->ctl, ioaddr->ctl_addr); 559 ata_sff_set_devctl(ap, ap->ctl);
554 tmp = ata_wait_idle(ap); 560 ata_wait_idle(ap);
555 561
556 ap->ops->sff_irq_clear(ap); 562 ap->ops->sff_irq_clear(ap);
557
558 return tmp;
559} 563}
560EXPORT_SYMBOL_GPL(ata_sff_irq_on); 564EXPORT_SYMBOL_GPL(ata_sff_irq_on);
561 565
@@ -1186,7 +1190,7 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq)
1186 qc = ata_qc_from_tag(ap, qc->tag); 1190 qc = ata_qc_from_tag(ap, qc->tag);
1187 if (qc) { 1191 if (qc) {
1188 if (likely(!(qc->err_mask & AC_ERR_HSM))) { 1192 if (likely(!(qc->err_mask & AC_ERR_HSM))) {
1189 ap->ops->sff_irq_on(ap); 1193 ata_sff_irq_on(ap);
1190 ata_qc_complete(qc); 1194 ata_qc_complete(qc);
1191 } else 1195 } else
1192 ata_port_freeze(ap); 1196 ata_port_freeze(ap);
@@ -1202,7 +1206,7 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq)
1202 } else { 1206 } else {
1203 if (in_wq) { 1207 if (in_wq) {
1204 spin_lock_irqsave(ap->lock, flags); 1208 spin_lock_irqsave(ap->lock, flags);
1205 ap->ops->sff_irq_on(ap); 1209 ata_sff_irq_on(ap);
1206 ata_qc_complete(qc); 1210 ata_qc_complete(qc);
1207 spin_unlock_irqrestore(ap->lock, flags); 1211 spin_unlock_irqrestore(ap->lock, flags);
1208 } else 1212 } else
@@ -1946,7 +1950,7 @@ void ata_sff_thaw(struct ata_port *ap)
1946 /* clear & re-enable interrupts */ 1950 /* clear & re-enable interrupts */
1947 ap->ops->sff_check_status(ap); 1951 ap->ops->sff_check_status(ap);
1948 ap->ops->sff_irq_clear(ap); 1952 ap->ops->sff_irq_clear(ap);
1949 ap->ops->sff_irq_on(ap); 1953 ata_sff_irq_on(ap);
1950} 1954}
1951EXPORT_SYMBOL_GPL(ata_sff_thaw); 1955EXPORT_SYMBOL_GPL(ata_sff_thaw);
1952 1956