icside: use ec->dma directly

* hwif->hwif_data contains pointer to struct expansion_card so use ec->dma
  directly instead of caching it in hwif->hw.dma.

* Remove no longer needed hw_regs_t.dma and NO_DMA define.

Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 8f173b5b
...@@ -316,27 +316,29 @@ static int icside_dma_end(ide_drive_t *drive) ...@@ -316,27 +316,29 @@ static int icside_dma_end(ide_drive_t *drive)
drive->waiting_for_dma = 0; drive->waiting_for_dma = 0;
disable_dma(hwif->hw.dma); disable_dma(state->dev->dma);
/* Teardown mappings after DMA has completed. */ /* Teardown mappings after DMA has completed. */
dma_unmap_sg(state->dev, hwif->sg_table, hwif->sg_nents, dma_unmap_sg(state->dev, hwif->sg_table, hwif->sg_nents,
hwif->sg_dma_direction); hwif->sg_dma_direction);
return get_dma_residue(hwif->hw.dma) != 0; return get_dma_residue(state->dev->dma) != 0;
} }
static void icside_dma_start(ide_drive_t *drive) static void icside_dma_start(ide_drive_t *drive)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
struct icside_state *state = hwif->hwif_data;
/* We can not enable DMA on both channels simultaneously. */ /* We can not enable DMA on both channels simultaneously. */
BUG_ON(dma_channel_active(hwif->hw.dma)); BUG_ON(dma_channel_active(state->dev->dma));
enable_dma(hwif->hw.dma); enable_dma(state->dev->dma);
} }
static int icside_dma_setup(ide_drive_t *drive) static int icside_dma_setup(ide_drive_t *drive)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
struct icside_state *state = hwif->hwif_data;
struct request *rq = hwif->hwgroup->rq; struct request *rq = hwif->hwgroup->rq;
unsigned int dma_mode; unsigned int dma_mode;
...@@ -348,7 +350,7 @@ static int icside_dma_setup(ide_drive_t *drive) ...@@ -348,7 +350,7 @@ static int icside_dma_setup(ide_drive_t *drive)
/* /*
* We can not enable DMA on both channels. * We can not enable DMA on both channels.
*/ */
BUG_ON(dma_channel_active(hwif->hw.dma)); BUG_ON(dma_channel_active(state->dev->dma));
icside_build_sglist(drive, rq); icside_build_sglist(drive, rq);
...@@ -365,14 +367,14 @@ static int icside_dma_setup(ide_drive_t *drive) ...@@ -365,14 +367,14 @@ static int icside_dma_setup(ide_drive_t *drive)
/* /*
* Select the correct timing for this drive. * Select the correct timing for this drive.
*/ */
set_dma_speed(hwif->hw.dma, drive->drive_data); set_dma_speed(state->dev->dma, drive->drive_data);
/* /*
* Tell the DMA engine about the SG table and * Tell the DMA engine about the SG table and
* data direction. * data direction.
*/ */
set_dma_sg(hwif->hw.dma, hwif->sg_table, hwif->sg_nents); set_dma_sg(state->dev->dma, hwif->sg_table, hwif->sg_nents);
set_dma_mode(hwif->hw.dma, dma_mode); set_dma_mode(state->dev->dma, dma_mode);
drive->waiting_for_dma = 1; drive->waiting_for_dma = 1;
...@@ -572,7 +574,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec) ...@@ -572,7 +574,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
hwif->serialized = 1; hwif->serialized = 1;
hwif->config_data = (unsigned long)ioc_base; hwif->config_data = (unsigned long)ioc_base;
hwif->select_data = sel; hwif->select_data = sel;
hwif->hw.dma = ec->dma;
mate->maskproc = icside_maskproc; mate->maskproc = icside_maskproc;
mate->channel = 1; mate->channel = 1;
...@@ -581,7 +582,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec) ...@@ -581,7 +582,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
mate->serialized = 1; mate->serialized = 1;
mate->config_data = (unsigned long)ioc_base; mate->config_data = (unsigned long)ioc_base;
mate->select_data = sel | 1; mate->select_data = sel | 1;
mate->hw.dma = ec->dma;
if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) {
icside_dma_init(hwif); icside_dma_init(hwif);
......
...@@ -68,7 +68,6 @@ static inline void hw_setup(hw_regs_t *hw) ...@@ -68,7 +68,6 @@ static inline void hw_setup(hw_regs_t *hw)
hw->io_ports[i] = CONFIG_H8300_IDE_BASE + H8300_IDE_GAP*i; hw->io_ports[i] = CONFIG_H8300_IDE_BASE + H8300_IDE_GAP*i;
hw->io_ports[IDE_CONTROL_OFFSET] = CONFIG_H8300_IDE_ALT; hw->io_ports[IDE_CONTROL_OFFSET] = CONFIG_H8300_IDE_ALT;
hw->irq = EXT_IRQ0 + CONFIG_H8300_IDE_IRQ; hw->irq = EXT_IRQ0 + CONFIG_H8300_IDE_IRQ;
hw->dma = NO_DMA;
hw->chipset = ide_generic; hw->chipset = ide_generic;
} }
......
...@@ -40,7 +40,6 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id ...@@ -40,7 +40,6 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
ide_std_init_ports(&hw, pnp_port_start(dev, 0), ide_std_init_ports(&hw, pnp_port_start(dev, 0),
pnp_port_start(dev, 1)); pnp_port_start(dev, 1));
hw.irq = pnp_irq(dev, 0); hw.irq = pnp_irq(dev, 0);
hw.dma = NO_DMA;
index = ide_register_hw(&hw, NULL, 1, &hwif); index = ide_register_hw(&hw, NULL, 1, &hwif);
......
...@@ -678,7 +678,6 @@ void ide_setup_ports ( hw_regs_t *hw, ...@@ -678,7 +678,6 @@ void ide_setup_ports ( hw_regs_t *hw,
} }
} }
hw->irq = irq; hw->irq = irq;
hw->dma = NO_DMA;
hw->ack_intr = ack_intr; hw->ack_intr = ack_intr;
/* /*
* hw->iops = iops; * hw->iops = iops;
......
...@@ -51,7 +51,6 @@ static ide_hwif_t *__devinit plat_ide_locate_hwif(void __iomem *base, ...@@ -51,7 +51,6 @@ static ide_hwif_t *__devinit plat_ide_locate_hwif(void __iomem *base,
memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports));
hwif->hw.irq = hwif->irq = irq; hwif->hw.irq = hwif->irq = irq;
hwif->hw.dma = NO_DMA;
hwif->chipset = hwif->hw.chipset = ide_generic; hwif->chipset = hwif->hw.chipset = ide_generic;
if (mmio) { if (mmio) {
......
...@@ -89,9 +89,8 @@ void q40_ide_setup_ports ( hw_regs_t *hw, ...@@ -89,9 +89,8 @@ void q40_ide_setup_ports ( hw_regs_t *hw,
else else
hw->io_ports[i] = Q40_ISA_IO_B(base + offsets[i]); hw->io_ports[i] = Q40_ISA_IO_B(base + offsets[i]);
} }
hw->irq = irq; hw->irq = irq;
hw->dma = NO_DMA;
hw->ack_intr = ack_intr; hw->ack_intr = ack_intr;
/* /*
* hw->iops = iops; * hw->iops = iops;
......
...@@ -192,10 +192,6 @@ typedef unsigned char byte; /* used everywhere */ ...@@ -192,10 +192,6 @@ typedef unsigned char byte; /* used everywhere */
struct hwif_s; struct hwif_s;
typedef int (ide_ack_intr_t)(struct hwif_s *); typedef int (ide_ack_intr_t)(struct hwif_s *);
#ifndef NO_DMA
#define NO_DMA 255
#endif
/* /*
* hwif_chipset_t is used to keep track of the specific hardware * hwif_chipset_t is used to keep track of the specific hardware
* chipset used by each IDE interface, if known. * chipset used by each IDE interface, if known.
...@@ -217,7 +213,6 @@ typedef u8 hwif_chipset_t; ...@@ -217,7 +213,6 @@ typedef u8 hwif_chipset_t;
typedef struct hw_regs_s { typedef struct hw_regs_s {
unsigned long io_ports[IDE_NR_PORTS]; /* task file registers */ unsigned long io_ports[IDE_NR_PORTS]; /* task file registers */
int irq; /* our irq number */ int irq; /* our irq number */
int dma; /* our dma entry */
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
hwif_chipset_t chipset; hwif_chipset_t chipset;
struct device *dev; struct device *dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment