ide: remove ->mmio flag from ide_hwif_t

Since scc_pata host driver no longer uses IDE PCI layer / ide_dma_setup()
and all other ->mmio users set also IDE_HFLAG_MMIO host flag we can safely
remove ->mmio flag.

There should be no functional changes caused by this patch.
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 ed4af48f
...@@ -405,7 +405,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) ...@@ -405,7 +405,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
ide_init_port_data(hwif, i); ide_init_port_data(hwif, i);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
hwif->mmio = 1;
default_hwif_mmiops(hwif); default_hwif_mmiops(hwif);
idx[0] = i; idx[0] = i;
......
...@@ -463,7 +463,7 @@ int ide_dma_setup(ide_drive_t *drive) ...@@ -463,7 +463,7 @@ int ide_dma_setup(ide_drive_t *drive)
} }
/* PRD table */ /* PRD table */
if (hwif->mmio) if (hwif->host_flags & IDE_HFLAG_MMIO)
writel(hwif->dmatable_dma, writel(hwif->dmatable_dma,
(void __iomem *)(hwif->dma_base + ATA_DMA_TABLE_OFS)); (void __iomem *)(hwif->dma_base + ATA_DMA_TABLE_OFS));
else else
......
...@@ -793,7 +793,6 @@ static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif) ...@@ -793,7 +793,6 @@ static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif)
hwif->dma_base = dma_base; hwif->dma_base = dma_base;
hwif->config_data = ports->ctl; hwif->config_data = ports->ctl;
hwif->mmio = 1;
} }
/** /**
......
...@@ -94,7 +94,7 @@ static unsigned long siimage_selreg(ide_hwif_t *hwif, int r) ...@@ -94,7 +94,7 @@ static unsigned long siimage_selreg(ide_hwif_t *hwif, int r)
unsigned long base = (unsigned long)hwif->hwif_data; unsigned long base = (unsigned long)hwif->hwif_data;
base += 0xA0 + r; base += 0xA0 + r;
if (hwif->mmio) if (hwif->host_flags & IDE_HFLAG_MMIO)
base += hwif->channel << 6; base += hwif->channel << 6;
else else
base += hwif->channel << 4; base += hwif->channel << 4;
...@@ -117,7 +117,7 @@ static inline unsigned long siimage_seldev(ide_drive_t *drive, int r) ...@@ -117,7 +117,7 @@ static inline unsigned long siimage_seldev(ide_drive_t *drive, int r)
unsigned long base = (unsigned long)hwif->hwif_data; unsigned long base = (unsigned long)hwif->hwif_data;
base += 0xA0 + r; base += 0xA0 + r;
if (hwif->mmio) if (hwif->host_flags & IDE_HFLAG_MMIO)
base += hwif->channel << 6; base += hwif->channel << 6;
else else
base += hwif->channel << 4; base += hwif->channel << 4;
...@@ -190,7 +190,9 @@ static u8 sil_pata_udma_filter(ide_drive_t *drive) ...@@ -190,7 +190,9 @@ static u8 sil_pata_udma_filter(ide_drive_t *drive)
unsigned long base = (unsigned long)hwif->hwif_data; unsigned long base = (unsigned long)hwif->hwif_data;
u8 scsc, mask = 0; u8 scsc, mask = 0;
scsc = sil_ioread8(dev, base + (hwif->mmio ? 0x4A : 0x8A)); base += (hwif->host_flags & IDE_HFLAG_MMIO) ? 0x4A : 0x8A;
scsc = sil_ioread8(dev, base);
switch (scsc & 0x30) { switch (scsc & 0x30) {
case 0x10: /* 133 */ case 0x10: /* 133 */
...@@ -238,8 +240,9 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio) ...@@ -238,8 +240,9 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio)
unsigned long tfaddr = siimage_selreg(hwif, 0x02); unsigned long tfaddr = siimage_selreg(hwif, 0x02);
unsigned long base = (unsigned long)hwif->hwif_data; unsigned long base = (unsigned long)hwif->hwif_data;
u8 tf_pio = pio; u8 tf_pio = pio;
u8 addr_mask = hwif->channel ? (hwif->mmio ? 0xF4 : 0x84) u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
: (hwif->mmio ? 0xB4 : 0x80); u8 addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84)
: (mmio ? 0xB4 : 0x80);
u8 mode = 0; u8 mode = 0;
u8 unit = drive->select.b.unit; u8 unit = drive->select.b.unit;
...@@ -290,13 +293,13 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed) ...@@ -290,13 +293,13 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed)
u16 ultra = 0, multi = 0; u16 ultra = 0, multi = 0;
u8 mode = 0, unit = drive->select.b.unit; u8 mode = 0, unit = drive->select.b.unit;
unsigned long base = (unsigned long)hwif->hwif_data; unsigned long base = (unsigned long)hwif->hwif_data;
u8 scsc = 0, addr_mask = hwif->channel ? u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
(hwif->mmio ? 0xF4 : 0x84) : u8 scsc = 0, addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84)
(hwif->mmio ? 0xB4 : 0x80); : (mmio ? 0xB4 : 0x80);
unsigned long ma = siimage_seldev(drive, 0x08); unsigned long ma = siimage_seldev(drive, 0x08);
unsigned long ua = siimage_seldev(drive, 0x0C); unsigned long ua = siimage_seldev(drive, 0x0C);
scsc = sil_ioread8 (dev, base + (hwif->mmio ? 0x4A : 0x8A)); scsc = sil_ioread8 (dev, base + (mmio ? 0x4A : 0x8A));
mode = sil_ioread8 (dev, base + addr_mask); mode = sil_ioread8 (dev, base + addr_mask);
multi = sil_ioread16(dev, ma); multi = sil_ioread16(dev, ma);
ultra = sil_ioread16(dev, ua); ultra = sil_ioread16(dev, ua);
...@@ -391,7 +394,7 @@ static int siimage_mmio_dma_test_irq(ide_drive_t *drive) ...@@ -391,7 +394,7 @@ static int siimage_mmio_dma_test_irq(ide_drive_t *drive)
static int siimage_dma_test_irq(ide_drive_t *drive) static int siimage_dma_test_irq(ide_drive_t *drive)
{ {
if (drive->hwif->mmio) if (drive->hwif->host_flags & IDE_HFLAG_MMIO)
return siimage_mmio_dma_test_irq(drive); return siimage_mmio_dma_test_irq(drive);
else else
return siimage_io_dma_test_irq(drive); return siimage_io_dma_test_irq(drive);
...@@ -640,8 +643,6 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif) ...@@ -640,8 +643,6 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
hwif->irq = dev->irq; hwif->irq = dev->irq;
hwif->dma_base = (unsigned long)addr + (ch ? 0x08 : 0x00); hwif->dma_base = (unsigned long)addr + (ch ? 0x08 : 0x00);
hwif->mmio = 1;
} }
static int is_dev_seagate_sata(ide_drive_t *drive) static int is_dev_seagate_sata(ide_drive_t *drive)
......
...@@ -87,7 +87,7 @@ unsigned long ide_pci_dma_base(ide_hwif_t *hwif, const struct ide_port_info *d) ...@@ -87,7 +87,7 @@ unsigned long ide_pci_dma_base(ide_hwif_t *hwif, const struct ide_port_info *d)
unsigned long dma_base = 0; unsigned long dma_base = 0;
u8 dma_stat = 0; u8 dma_stat = 0;
if (hwif->mmio) if (hwif->host_flags & IDE_HFLAG_MMIO)
return hwif->dma_base; return hwif->dma_base;
if (hwif->mate && hwif->mate->dma_base) { if (hwif->mate && hwif->mate->dma_base) {
...@@ -374,7 +374,7 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif, const struct ide_port_info *d) ...@@ -374,7 +374,7 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
if (base == 0 || ide_pci_set_master(dev, d->name) < 0) if (base == 0 || ide_pci_set_master(dev, d->name) < 0)
return -1; return -1;
if (hwif->mmio) if (hwif->host_flags & IDE_HFLAG_MMIO)
printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name); printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);
else else
printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n", printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n",
......
...@@ -532,7 +532,6 @@ typedef struct hwif_s { ...@@ -532,7 +532,6 @@ typedef struct hwif_s {
unsigned serialized : 1; /* serialized all channel operation */ unsigned serialized : 1; /* serialized all channel operation */
unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */
unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
unsigned mmio : 1; /* host uses MMIO */
struct device gendev; struct device gendev;
struct device *portdev; struct device *portdev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册