diff options
author | Tejun Heo <htejun@gmail.com> | 2006-10-08 22:10:26 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-01 22:40:28 -0500 |
commit | 90088bb41200b4da962282dfd45db82544adac3b (patch) | |
tree | 84241a4af54715469dd237bd6925f46530f2b5b7 | |
parent | d1adc1bbd6dde3e05a91e2d3e6ab42d202ea61d5 (diff) |
[PATCH] libata: move ata_irq_on() into libata-sff.c
ata_irq_on() isn't used outside of libata core layer. The function is
TF/SFF interface specific but currently used by core path with some
hack too. Move it from include/linux/libata.h to
drivers/ata/libata-sff.c.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/ata/libata-sff.c | 29 | ||||
-rw-r--r-- | drivers/ata/libata.h | 3 | ||||
-rw-r--r-- | include/linux/libata.h | 31 |
3 files changed, 32 insertions, 31 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index e178d6ae8b80..37471d3c1c28 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -39,6 +39,35 @@ | |||
39 | #include "libata.h" | 39 | #include "libata.h" |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * ata_irq_on - Enable interrupts on a port. | ||
43 | * @ap: Port on which interrupts are enabled. | ||
44 | * | ||
45 | * Enable interrupts on a legacy IDE device using MMIO or PIO, | ||
46 | * wait for idle, clear any pending interrupts. | ||
47 | * | ||
48 | * LOCKING: | ||
49 | * Inherited from caller. | ||
50 | */ | ||
51 | u8 ata_irq_on(struct ata_port *ap) | ||
52 | { | ||
53 | struct ata_ioports *ioaddr = &ap->ioaddr; | ||
54 | u8 tmp; | ||
55 | |||
56 | ap->ctl &= ~ATA_NIEN; | ||
57 | ap->last_ctl = ap->ctl; | ||
58 | |||
59 | if (ap->flags & ATA_FLAG_MMIO) | ||
60 | writeb(ap->ctl, (void __iomem *) ioaddr->ctl_addr); | ||
61 | else | ||
62 | outb(ap->ctl, ioaddr->ctl_addr); | ||
63 | tmp = ata_wait_idle(ap); | ||
64 | |||
65 | ap->ops->irq_clear(ap); | ||
66 | |||
67 | return tmp; | ||
68 | } | ||
69 | |||
70 | /** | ||
42 | * ata_tf_load_pio - send taskfile registers to host controller | 71 | * ata_tf_load_pio - send taskfile registers to host controller |
43 | * @ap: Port to which output is sent | 72 | * @ap: Port to which output is sent |
44 | * @tf: ATA taskfile register set | 73 | * @tf: ATA taskfile register set |
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 0ed263be652a..c83300055ec5 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -120,4 +120,7 @@ extern void ata_scsi_error(struct Scsi_Host *host); | |||
120 | extern void ata_port_wait_eh(struct ata_port *ap); | 120 | extern void ata_port_wait_eh(struct ata_port *ap); |
121 | extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc); | 121 | extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc); |
122 | 122 | ||
123 | /* libata-sff.c */ | ||
124 | extern u8 ata_irq_on(struct ata_port *ap); | ||
125 | |||
123 | #endif /* __LIBATA_H__ */ | 126 | #endif /* __LIBATA_H__ */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 6c003d852a88..d3bf7b936c3f 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -1150,37 +1150,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) | |||
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | /** | 1152 | /** |
1153 | * ata_irq_on - Enable interrupts on a port. | ||
1154 | * @ap: Port on which interrupts are enabled. | ||
1155 | * | ||
1156 | * Enable interrupts on a legacy IDE device using MMIO or PIO, | ||
1157 | * wait for idle, clear any pending interrupts. | ||
1158 | * | ||
1159 | * LOCKING: | ||
1160 | * Inherited from caller. | ||
1161 | */ | ||
1162 | |||
1163 | static inline u8 ata_irq_on(struct ata_port *ap) | ||
1164 | { | ||
1165 | struct ata_ioports *ioaddr = &ap->ioaddr; | ||
1166 | u8 tmp; | ||
1167 | |||
1168 | ap->ctl &= ~ATA_NIEN; | ||
1169 | ap->last_ctl = ap->ctl; | ||
1170 | |||
1171 | if (ap->flags & ATA_FLAG_MMIO) | ||
1172 | writeb(ap->ctl, (void __iomem *) ioaddr->ctl_addr); | ||
1173 | else | ||
1174 | outb(ap->ctl, ioaddr->ctl_addr); | ||
1175 | tmp = ata_wait_idle(ap); | ||
1176 | |||
1177 | ap->ops->irq_clear(ap); | ||
1178 | |||
1179 | return tmp; | ||
1180 | } | ||
1181 | |||
1182 | |||
1183 | /** | ||
1184 | * ata_irq_ack - Acknowledge a device interrupt. | 1153 | * ata_irq_ack - Acknowledge a device interrupt. |
1185 | * @ap: Port on which interrupts are enabled. | 1154 | * @ap: Port on which interrupts are enabled. |
1186 | * | 1155 | * |