aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/scc_pata.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/scc_pata.c')
-rw-r--r--drivers/ide/scc_pata.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c
index 1104bb301eb9..b7f5b0c4310c 100644
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -199,16 +199,15 @@ scc_ide_outsl(unsigned long port, void *addr, u32 count)
199 199
200/** 200/**
201 * scc_set_pio_mode - set host controller for PIO mode 201 * scc_set_pio_mode - set host controller for PIO mode
202 * @hwif: port
202 * @drive: drive 203 * @drive: drive
203 * @pio: PIO mode number
204 * 204 *
205 * Load the timing settings for this device mode into the 205 * Load the timing settings for this device mode into the
206 * controller. 206 * controller.
207 */ 207 */
208 208
209static void scc_set_pio_mode(ide_drive_t *drive, const u8 pio) 209static void scc_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
210{ 210{
211 ide_hwif_t *hwif = drive->hwif;
212 struct scc_ports *ports = ide_get_hwifdata(hwif); 211 struct scc_ports *ports = ide_get_hwifdata(hwif);
213 unsigned long ctl_base = ports->ctl; 212 unsigned long ctl_base = ports->ctl;
214 unsigned long cckctrl_port = ctl_base + 0xff0; 213 unsigned long cckctrl_port = ctl_base + 0xff0;
@@ -216,6 +215,7 @@ static void scc_set_pio_mode(ide_drive_t *drive, const u8 pio)
216 unsigned long pioct_port = ctl_base + 0x004; 215 unsigned long pioct_port = ctl_base + 0x004;
217 unsigned long reg; 216 unsigned long reg;
218 int offset; 217 int offset;
218 const u8 pio = drive->pio_mode - XFER_PIO_0;
219 219
220 reg = in_be32((void __iomem *)cckctrl_port); 220 reg = in_be32((void __iomem *)cckctrl_port);
221 if (reg & CCKCTRL_ATACLKOEN) { 221 if (reg & CCKCTRL_ATACLKOEN) {
@@ -231,16 +231,15 @@ static void scc_set_pio_mode(ide_drive_t *drive, const u8 pio)
231 231
232/** 232/**
233 * scc_set_dma_mode - set host controller for DMA mode 233 * scc_set_dma_mode - set host controller for DMA mode
234 * @hwif: port
234 * @drive: drive 235 * @drive: drive
235 * @speed: DMA mode
236 * 236 *
237 * Load the timing settings for this device mode into the 237 * Load the timing settings for this device mode into the
238 * controller. 238 * controller.
239 */ 239 */
240 240
241static void scc_set_dma_mode(ide_drive_t *drive, const u8 speed) 241static void scc_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
242{ 242{
243 ide_hwif_t *hwif = drive->hwif;
244 struct scc_ports *ports = ide_get_hwifdata(hwif); 243 struct scc_ports *ports = ide_get_hwifdata(hwif);
245 unsigned long ctl_base = ports->ctl; 244 unsigned long ctl_base = ports->ctl;
246 unsigned long cckctrl_port = ctl_base + 0xff0; 245 unsigned long cckctrl_port = ctl_base + 0xff0;
@@ -254,6 +253,7 @@ static void scc_set_dma_mode(ide_drive_t *drive, const u8 speed)
254 int offset, idx; 253 int offset, idx;
255 unsigned long reg; 254 unsigned long reg;
256 unsigned long jcactsel; 255 unsigned long jcactsel;
256 const u8 speed = drive->dma_mode;
257 257
258 reg = in_be32((void __iomem *)cckctrl_port); 258 reg = in_be32((void __iomem *)cckctrl_port);
259 if (reg & CCKCTRL_ATACLKOEN) { 259 if (reg & CCKCTRL_ATACLKOEN) {
@@ -872,20 +872,18 @@ static struct pci_driver scc_pci_driver = {
872 .remove = __devexit_p(scc_remove), 872 .remove = __devexit_p(scc_remove),
873}; 873};
874 874
875static int scc_ide_init(void) 875static int __init scc_ide_init(void)
876{ 876{
877 return ide_pci_register_driver(&scc_pci_driver); 877 return ide_pci_register_driver(&scc_pci_driver);
878} 878}
879 879
880module_init(scc_ide_init); 880static void __exit scc_ide_exit(void)
881/* -- No exit code?
882static void scc_ide_exit(void)
883{ 881{
884 ide_pci_unregister_driver(&scc_pci_driver); 882 pci_unregister_driver(&scc_pci_driver);
885} 883}
886module_exit(scc_ide_exit);
887 */
888 884
885module_init(scc_ide_init);
886module_exit(scc_ide_exit);
889 887
890MODULE_DESCRIPTION("PCI driver module for Toshiba SCC IDE"); 888MODULE_DESCRIPTION("PCI driver module for Toshiba SCC IDE");
891MODULE_LICENSE("GPL"); 889MODULE_LICENSE("GPL");