aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/mips
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/mips')
-rw-r--r--drivers/ide/mips/au1xxx-ide.c13
-rw-r--r--drivers/ide/mips/swarm.c28
2 files changed, 20 insertions, 21 deletions
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index 1a6c27b32498..48d57cae63c6 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -213,10 +213,8 @@ static int auide_build_dmatable(ide_drive_t *drive)
213{ 213{
214 int i, iswrite, count = 0; 214 int i, iswrite, count = 0;
215 ide_hwif_t *hwif = HWIF(drive); 215 ide_hwif_t *hwif = HWIF(drive);
216
217 struct request *rq = HWGROUP(drive)->rq; 216 struct request *rq = HWGROUP(drive)->rq;
218 217 _auide_hwif *ahwif = &auide_hwif;
219 _auide_hwif *ahwif = (_auide_hwif*)hwif->hwif_data;
220 struct scatterlist *sg; 218 struct scatterlist *sg;
221 219
222 iswrite = (rq_data_dir(rq) == WRITE); 220 iswrite = (rq_data_dir(rq) == WRITE);
@@ -402,7 +400,7 @@ static const struct ide_dma_ops au1xxx_dma_ops = {
402 400
403static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d) 401static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
404{ 402{
405 _auide_hwif *auide = (_auide_hwif *)hwif->hwif_data; 403 _auide_hwif *auide = &auide_hwif;
406 dbdev_tab_t source_dev_tab, target_dev_tab; 404 dbdev_tab_t source_dev_tab, target_dev_tab;
407 u32 dev_id, tsize, devwidth, flags; 405 u32 dev_id, tsize, devwidth, flags;
408 406
@@ -463,7 +461,7 @@ static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
463#else 461#else
464static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d) 462static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
465{ 463{
466 _auide_hwif *auide = (_auide_hwif *)hwif->hwif_data; 464 _auide_hwif *auide = &auide_hwif;
467 dbdev_tab_t source_dev_tab; 465 dbdev_tab_t source_dev_tab;
468 int flags; 466 int flags;
469 467
@@ -600,8 +598,6 @@ static int au_ide_probe(struct device *dev)
600 598
601 ide_init_port_hw(hwif, &hw); 599 ide_init_port_hw(hwif, &hw);
602 600
603 hwif->dev = dev;
604
605 /* If the user has selected DDMA assisted copies, 601 /* If the user has selected DDMA assisted copies,
606 then set up a few local I/O function entry points 602 then set up a few local I/O function entry points
607 */ 603 */
@@ -610,11 +606,8 @@ static int au_ide_probe(struct device *dev)
610 hwif->input_data = au1xxx_input_data; 606 hwif->input_data = au1xxx_input_data;
611 hwif->output_data = au1xxx_output_data; 607 hwif->output_data = au1xxx_output_data;
612#endif 608#endif
613 hwif->select_data = 0; /* no chipset-specific code */
614 hwif->config_data = 0; /* no chipset-specific code */
615 609
616 auide_hwif.hwif = hwif; 610 auide_hwif.hwif = hwif;
617 hwif->hwif_data = &auide_hwif;
618 611
619 idx[0] = hwif->index; 612 idx[0] = hwif->index;
620 613
diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c
index 52fee3d2771a..9f1212cc4aed 100644
--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -61,6 +61,11 @@ static struct resource swarm_ide_resource = {
61 61
62static struct platform_device *swarm_ide_dev; 62static struct platform_device *swarm_ide_dev;
63 63
64static const struct ide_port_info swarm_port_info = {
65 .name = DRV_NAME,
66 .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
67};
68
64/* 69/*
65 * swarm_ide_probe - if the board header indicates the existence of 70 * swarm_ide_probe - if the board header indicates the existence of
66 * Generic Bus IDE, allocate a HWIF for it. 71 * Generic Bus IDE, allocate a HWIF for it.
@@ -77,12 +82,6 @@ static int __devinit swarm_ide_probe(struct device *dev)
77 if (!SIBYTE_HAVE_IDE) 82 if (!SIBYTE_HAVE_IDE)
78 return -ENODEV; 83 return -ENODEV;
79 84
80 hwif = ide_find_port();
81 if (hwif == NULL) {
82 printk(KERN_ERR DRV_NAME ": no free slot for interface\n");
83 return -ENOMEM;
84 }
85
86 base = ioremap(A_IO_EXT_BASE, 0x800); 85 base = ioremap(A_IO_EXT_BASE, 0x800);
87 offset = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_START_ADDR, IDE_CS)); 86 offset = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_START_ADDR, IDE_CS));
88 size = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_MULT_SIZE, IDE_CS)); 87 size = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_MULT_SIZE, IDE_CS));
@@ -109,10 +108,6 @@ static int __devinit swarm_ide_probe(struct device *dev)
109 108
110 base = ioremap(offset, size); 109 base = ioremap(offset, size);
111 110
112 /* Setup MMIO ops. */
113 hwif->host_flags = IDE_HFLAG_MMIO;
114 default_hwif_mmiops(hwif);
115
116 for (i = 0; i <= 7; i++) 111 for (i = 0; i <= 7; i++)
117 hw.io_ports_array[i] = 112 hw.io_ports_array[i] =
118 (unsigned long)(base + ((0x1f0 + i) << 5)); 113 (unsigned long)(base + ((0x1f0 + i) << 5));
@@ -121,15 +116,26 @@ static int __devinit swarm_ide_probe(struct device *dev)
121 hw.irq = K_INT_GB_IDE; 116 hw.irq = K_INT_GB_IDE;
122 hw.chipset = ide_generic; 117 hw.chipset = ide_generic;
123 118
119 hwif = ide_find_port_slot(&swarm_port_info);
120 if (hwif == NULL)
121 goto err;
122
124 ide_init_port_hw(hwif, &hw); 123 ide_init_port_hw(hwif, &hw);
125 124
125 /* Setup MMIO ops. */
126 default_hwif_mmiops(hwif);
127
126 idx[0] = hwif->index; 128 idx[0] = hwif->index;
127 129
128 ide_device_add(idx, NULL); 130 ide_device_add(idx, &swarm_port_info);
129 131
130 dev_set_drvdata(dev, hwif); 132 dev_set_drvdata(dev, hwif);
131 133
132 return 0; 134 return 0;
135err:
136 release_resource(&swarm_ide_resource);
137 iounmap(base);
138 return -ENOMEM;
133} 139}
134 140
135static struct device_driver swarm_ide_driver = { 141static struct device_driver swarm_ide_driver = {