diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:47 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:47 -0400 |
commit | 22117d6eaac50d366d9013c88318a869ea4d8739 (patch) | |
tree | 7dae55b028f8c7c249341f026257f94c88eed3cf /drivers/ide/ide-dma-sff.c | |
parent | 60c0cd02b254805691cdc61101ada6af7bd56fde (diff) |
ide: add ->dma_timer_expiry method and remove ->dma_exec_cmd one (v2)
* Rename dma_timer_expiry() to ide_dma_sff_timer_expiry() and export it.
* Add ->dma_timer_expiry method and use it to set hwif->expiry for
ATA_PROT_DMA protocol in do_rw_taskfile().
* Initialize ->dma_timer_expiry to ide_dma_sff_timer_expiry() for SFF hosts.
* Move setting hwif->expiry from ide_execute_command() to its users and drop
'expiry' argument.
* Use ide_execute_command() instead of ->dma_exec_cmd in do_rw_taskfile().
* Remove ->dma_exec_cmd method and its implementations.
* Unexport ide_execute_command() and ide_dma_intr().
v2:
* Fix CONFIG_BLK_DEV_IDEDMA=n build (noticed by Randy Dunlap).
* Fix *dma_expiry naming (suggested by Sergei Shtylyov).
There should be no functional changes caused by this patch.
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma-sff.c')
-rw-r--r-- | drivers/ide/ide-dma-sff.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/ide/ide-dma-sff.c b/drivers/ide/ide-dma-sff.c index b7eb810c7b8f..75a9ea2e4c82 100644 --- a/drivers/ide/ide-dma-sff.c +++ b/drivers/ide/ide-dma-sff.c | |||
@@ -224,7 +224,7 @@ int ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) | |||
224 | EXPORT_SYMBOL_GPL(ide_dma_setup); | 224 | EXPORT_SYMBOL_GPL(ide_dma_setup); |
225 | 225 | ||
226 | /** | 226 | /** |
227 | * dma_timer_expiry - handle a DMA timeout | 227 | * ide_dma_sff_timer_expiry - handle a DMA timeout |
228 | * @drive: Drive that timed out | 228 | * @drive: Drive that timed out |
229 | * | 229 | * |
230 | * An IDE DMA transfer timed out. In the event of an error we ask | 230 | * An IDE DMA transfer timed out. In the event of an error we ask |
@@ -237,7 +237,7 @@ EXPORT_SYMBOL_GPL(ide_dma_setup); | |||
237 | * This can occur if an interrupt is lost or due to hang or bugs. | 237 | * This can occur if an interrupt is lost or due to hang or bugs. |
238 | */ | 238 | */ |
239 | 239 | ||
240 | static int dma_timer_expiry(ide_drive_t *drive) | 240 | int ide_dma_sff_timer_expiry(ide_drive_t *drive) |
241 | { | 241 | { |
242 | ide_hwif_t *hwif = drive->hwif; | 242 | ide_hwif_t *hwif = drive->hwif; |
243 | u8 dma_stat = hwif->dma_ops->dma_sff_read_status(hwif); | 243 | u8 dma_stat = hwif->dma_ops->dma_sff_read_status(hwif); |
@@ -261,14 +261,7 @@ static int dma_timer_expiry(ide_drive_t *drive) | |||
261 | 261 | ||
262 | return 0; /* Status is unknown -- reset the bus */ | 262 | return 0; /* Status is unknown -- reset the bus */ |
263 | } | 263 | } |
264 | 264 | EXPORT_SYMBOL_GPL(ide_dma_sff_timer_expiry); | |
265 | void ide_dma_exec_cmd(ide_drive_t *drive, u8 command) | ||
266 | { | ||
267 | /* issue cmd to drive */ | ||
268 | ide_execute_command(drive, command, &ide_dma_intr, 2 * WAIT_CMD, | ||
269 | dma_timer_expiry); | ||
270 | } | ||
271 | EXPORT_SYMBOL_GPL(ide_dma_exec_cmd); | ||
272 | 265 | ||
273 | void ide_dma_start(ide_drive_t *drive) | 266 | void ide_dma_start(ide_drive_t *drive) |
274 | { | 267 | { |
@@ -342,10 +335,10 @@ EXPORT_SYMBOL_GPL(ide_dma_test_irq); | |||
342 | const struct ide_dma_ops sff_dma_ops = { | 335 | const struct ide_dma_ops sff_dma_ops = { |
343 | .dma_host_set = ide_dma_host_set, | 336 | .dma_host_set = ide_dma_host_set, |
344 | .dma_setup = ide_dma_setup, | 337 | .dma_setup = ide_dma_setup, |
345 | .dma_exec_cmd = ide_dma_exec_cmd, | ||
346 | .dma_start = ide_dma_start, | 338 | .dma_start = ide_dma_start, |
347 | .dma_end = ide_dma_end, | 339 | .dma_end = ide_dma_end, |
348 | .dma_test_irq = ide_dma_test_irq, | 340 | .dma_test_irq = ide_dma_test_irq, |
341 | .dma_timer_expiry = ide_dma_sff_timer_expiry, | ||
349 | .dma_timeout = ide_dma_timeout, | 342 | .dma_timeout = ide_dma_timeout, |
350 | .dma_lost_irq = ide_dma_lost_irq, | 343 | .dma_lost_irq = ide_dma_lost_irq, |
351 | .dma_sff_read_status = ide_dma_sff_read_status, | 344 | .dma_sff_read_status = ide_dma_sff_read_status, |