diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:22 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:22 -0400 |
commit | b123f56e04c7c112f754f948198d1ea5a80e649d (patch) | |
tree | c58e83e954159d7755aa7f04d433e4c7e25dc330 /include/linux/ide.h | |
parent | f629b38beddf2ff8bc3fda1754bbd6cc7d3acc03 (diff) |
ide: do complete DMA setup in ->init_dma method (take 2)
* Make ide_hwif_setup_dma() return an error value.
* Pass 'const struct ide_port_info *d' instead of 'unsigned long dmabase'
to ->init_dma method and make it return an error value.
* Rename ide_get_or_set_dma_base() to ide_pci_dma_base(),
change ordering of its arguments and then export it.
* Export ide_pci_set_master().
* Do complete DMA setup inside ->init_dma method and update ->init_dma
users accordingly.
* Sanitize code for DMA setup in ide_init_port().
v2:
* Fix for CONFIG_BLK_DEV_IDEDMA_PCI=n configs
(from Jiri Slaby <jirislaby@gmail.com>):
Fix following compiler warning by returning EINVAL:
In file included from ANYTHING-INCLUDING-IDE.H:45:
include/linux/ide.h: In function ‘ide_hwif_setup_dma’:
include/linux/ide.h:1022: warning: no return statement in function returning non-void
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index b8a9d3b4d633..2da46af64604 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1007,10 +1007,15 @@ void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 | |||
1007 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 1007 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
1008 | 1008 | ||
1009 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1009 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
1010 | void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); | 1010 | int ide_pci_set_master(struct pci_dev *, const char *); |
1011 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); | ||
1012 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); | ||
1011 | #else | 1013 | #else |
1012 | static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, | 1014 | static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, |
1013 | const struct ide_port_info *d) { } | 1015 | const struct ide_port_info *d) |
1016 | { | ||
1017 | return -EINVAL; | ||
1018 | } | ||
1014 | #endif | 1019 | #endif |
1015 | 1020 | ||
1016 | extern void default_hwif_iops(ide_hwif_t *); | 1021 | extern void default_hwif_iops(ide_hwif_t *); |
@@ -1103,7 +1108,8 @@ struct ide_port_info { | |||
1103 | unsigned int (*init_chipset)(struct pci_dev *, const char *); | 1108 | unsigned int (*init_chipset)(struct pci_dev *, const char *); |
1104 | void (*init_iops)(ide_hwif_t *); | 1109 | void (*init_iops)(ide_hwif_t *); |
1105 | void (*init_hwif)(ide_hwif_t *); | 1110 | void (*init_hwif)(ide_hwif_t *); |
1106 | void (*init_dma)(ide_hwif_t *, unsigned long); | 1111 | int (*init_dma)(ide_hwif_t *, |
1112 | const struct ide_port_info *); | ||
1107 | 1113 | ||
1108 | const struct ide_port_ops *port_ops; | 1114 | const struct ide_port_ops *port_ops; |
1109 | 1115 | ||