Skip to content

Commit

Permalink
ide: remove chipset field from hw_regs_t
Browse files Browse the repository at this point in the history
* Convert host drivers that still use hw_regs_t's chipset field to use
  the one in struct ide_port_info instead.

* Move special handling of ide_pci chipset type from ide_hw_configure()
  to ide_init_port().

* Remove chipset field from hw_regs_t.

While at it:
- remove stale comment in delkin_cb.c

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed May 17, 2009
1 parent ca1b96e commit 29e52cf
Show file tree
Hide file tree
Showing 24 changed files with 20 additions and 34 deletions.
2 changes: 1 addition & 1 deletion drivers/ide/at91_ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ static const struct ide_port_info at91_ide_port_info __initdata = {
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA | IDE_HFLAG_SINGLE |
IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_UNMASK_IRQS,
.pio_mask = ATA_PIO6,
.chipset = ide_generic,
};

/*
Expand Down Expand Up @@ -304,7 +305,6 @@ static int __init at91_ide_probe(struct platform_device *pdev)
ide_std_init_ports(&hw, tf_base, ctl_base + 6);

hw.irq = board->irq_pin;
hw.chipset = ide_generic;
hw.dev = &pdev->dev;

host = ide_host_alloc(&at91_ide_port_info, hws);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/au1xxx-ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ static const struct ide_port_info au1xxx_port_info = {
#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
.mwdma_mask = ATA_MWDMA2,
#endif
.chipset = ide_au1xxx,
};

static int au_ide_probe(struct platform_device *dev)
Expand Down Expand Up @@ -548,7 +549,6 @@ static int au_ide_probe(struct platform_device *dev)
auide_setup_ports(&hw, ahwif);
hw.irq = ahwif->irq;
hw.dev = &dev->dev;
hw.chipset = ide_au1xxx;

ret = ide_host_add(&au1xxx_port_info, hws, &host);
if (ret)
Expand Down
3 changes: 1 addition & 2 deletions drivers/ide/buddha.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,12 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base,

hw->irq = IRQ_AMIGA_PORTS;
hw->ack_intr = ack_intr;

hw->chipset = ide_generic;
}

static const struct ide_port_info buddha_port_info = {
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
.irq_flags = IRQF_SHARED,
.chipset = ide_generic,
};

/*
Expand Down
2 changes: 0 additions & 2 deletions drivers/ide/cmd640.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,11 +762,9 @@ static int __init cmd640x_init(void)

ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
hw[0].irq = 14;
hw[0].chipset = ide_cmd640;

ide_std_init_ports(&hw[1], 0x170, 0x376);
hw[1].irq = 15;
hw[1].chipset = ide_cmd640;

printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x"
"\n", 'a' + cmd640_chip_version - 1, bus_type, cfr);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/delkin_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ static const struct ide_port_info delkin_cb_port_info = {
IDE_HFLAG_NO_DMA,
.irq_flags = IRQF_SHARED,
.init_chipset = delkin_cb_init_chipset,
.chipset = ide_pci,
};

static int __devinit
Expand Down Expand Up @@ -97,7 +98,6 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
ide_std_init_ports(&hw, base + 0x10, base + 0x1e);
hw.irq = dev->irq;
hw.dev = &dev->dev;
hw.chipset = ide_pci; /* this enables IRQ sharing */

rc = ide_host_add(&delkin_cb_port_info, hws, &host);
if (rc)
Expand Down
3 changes: 1 addition & 2 deletions drivers/ide/falconide.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ static const struct ide_port_info falconide_port_info = {
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_SERIALIZE |
IDE_HFLAG_NO_DMA,
.irq_flags = IRQF_SHARED,
.chipset = ide_generic,
};

static void __init falconide_setup_ports(hw_regs_t *hw)
Expand All @@ -128,8 +129,6 @@ static void __init falconide_setup_ports(hw_regs_t *hw)

hw->irq = IRQ_MFP_IDE;
hw->ack_intr = NULL;

hw->chipset = ide_generic;
}

/*
Expand Down
3 changes: 1 addition & 2 deletions drivers/ide/gayle.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,13 @@ static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,

hw->irq = IRQ_AMIGA_PORTS;
hw->ack_intr = ack_intr;

hw->chipset = ide_generic;
}

static const struct ide_port_info gayle_port_info = {
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_SERIALIZE |
IDE_HFLAG_NO_DMA,
.irq_flags = IRQF_SHARED,
.chipset = ide_generic,
};

/*
Expand Down
3 changes: 2 additions & 1 deletion drivers/ide/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,11 @@ static void icside_setup_ports(hw_regs_t *hw, void __iomem *base,

hw->irq = ec->irq;
hw->dev = &ec->dev;
hw->chipset = ide_acorn;
}

static const struct ide_port_info icside_v5_port_info = {
.host_flags = IDE_HFLAG_NO_DMA,
.chipset = ide_acorn,
};

static int __devinit
Expand Down Expand Up @@ -457,6 +457,7 @@ static const struct ide_port_info icside_v6_port_info __initdata = {
.host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO,
.mwdma_mask = ATA_MWDMA2,
.swdma_mask = ATA_SWDMA2,
.chipset = ide_acorn,
};

static int __devinit
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-4drives.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ static const struct ide_port_info ide_4drives_port_info = {
.port_ops = &ide_4drives_port_ops,
.host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_NO_DMA |
IDE_HFLAG_4DRIVES,
.chipset = ide_4drives,
};

static int __init ide_4drives_init(void)
Expand Down Expand Up @@ -52,7 +53,6 @@ static int __init ide_4drives_init(void)

ide_std_init_ports(&hw, base, ctl);
hw.irq = 14;
hw.chipset = ide_4drives;

return ide_host_add(&ide_4drives_port_info, hws, NULL);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ static const struct ide_port_info idecs_port_info = {
.port_ops = &idecs_port_ops,
.host_flags = IDE_HFLAG_NO_DMA,
.irq_flags = IRQF_SHARED,
.chipset = ide_pci,
};

static struct ide_host *idecs_register(unsigned long io, unsigned long ctl,
Expand All @@ -181,7 +182,6 @@ static struct ide_host *idecs_register(unsigned long io, unsigned long ctl,
memset(&hw, 0, sizeof(hw));
ide_std_init_ports(&hw, io, ctl);
hw.irq = irq;
hw.chipset = ide_pci;
hw.dev = &handle->dev;

rc = ide_host_add(&idecs_port_info, hws, &host);
Expand Down
3 changes: 1 addition & 2 deletions drivers/ide/ide-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ MODULE_PARM_DESC(probe_mask, "probe mask for legacy ISA IDE ports");

static const struct ide_port_info ide_generic_port_info = {
.host_flags = IDE_HFLAG_NO_DMA,
.chipset = ide_generic,
};

#ifdef CONFIG_ARM
Expand Down Expand Up @@ -132,8 +133,6 @@ static int __init ide_generic_init(void)
#else
hw.irq = legacy_irqs[i];
#endif
hw.chipset = ide_generic;

rc = ide_host_add(&ide_generic_port_info, hws, NULL);
if (rc) {
release_region(io_addr + 0x206, 1);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-h8300.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ static inline void hw_setup(hw_regs_t *hw)
hw->io_ports_array[i] = CONFIG_H8300_IDE_BASE + H8300_IDE_GAP*i;
hw->io_ports.ctl_addr = CONFIG_H8300_IDE_ALT;
hw->irq = EXT_IRQ0 + CONFIG_H8300_IDE_IRQ;
hw->chipset = ide_generic;
}

static const struct ide_port_info h8300_port_info = {
.tp_ops = &h8300_tp_ops,
.host_flags = IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_NO_DMA,
.chipset = ide_generic,
};

static int __init h8300_ide_init(void)
Expand Down
1 change: 0 additions & 1 deletion drivers/ide/ide-legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ static void ide_legacy_init_one(hw_regs_t **hws, hw_regs_t *hw,

ide_std_init_ports(hw, base, ctl);
hw->irq = irq;
hw->chipset = d->chipset;
hw->config = config;

hws[port_no] = hw;
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-pnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ static struct pnp_device_id idepnp_devices[] = {

static const struct ide_port_info ide_pnp_port_info = {
.host_flags = IDE_HFLAG_NO_DMA,
.chipset = ide_generic,
};

static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
Expand Down Expand Up @@ -62,7 +63,6 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
memset(&hw, 0, sizeof(hw));
ide_std_init_ports(&hw, base, ctl);
hw.irq = pnp_irq(dev, 0);
hw.chipset = ide_generic;

rc = ide_host_add(&ide_pnp_port_info, hws, &host);
if (rc)
Expand Down
4 changes: 1 addition & 3 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,8 +1048,7 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
{
hwif->channel = port;

if (d->chipset)
hwif->chipset = d->chipset;
hwif->chipset = d->chipset ? d->chipset : ide_pci;

if (d->init_iops)
d->init_iops(hwif);
Expand Down Expand Up @@ -1178,7 +1177,6 @@ static void ide_init_port_hw(ide_hwif_t *hwif, hw_regs_t *hw)
{
memcpy(&hwif->io_ports, &hw->io_ports, sizeof(hwif->io_ports));
hwif->irq = hw->irq;
hwif->chipset = hw->chipset;
hwif->dev = hw->dev;
hwif->gendev.parent = hw->parent ? hw->parent : hw->dev;
hwif->ack_intr = hw->ack_intr;
Expand Down
3 changes: 1 addition & 2 deletions drivers/ide/ide_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ static void __devinit plat_ide_setup_ports(hw_regs_t *hw,
hw->io_ports.ctl_addr = (unsigned long)ctrl;

hw->irq = irq;

hw->chipset = ide_generic;
}

static const struct ide_port_info platform_ide_port_info = {
.host_flags = IDE_HFLAG_NO_DMA,
.chipset = ide_generic,
};

static int __devinit plat_ide_probe(struct platform_device *pdev)
Expand Down
3 changes: 1 addition & 2 deletions drivers/ide/macide.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,12 @@ static void __init macide_setup_ports(hw_regs_t *hw, unsigned long base,

hw->irq = irq;
hw->ack_intr = ack_intr;

hw->chipset = ide_generic;
}

static const struct ide_port_info macide_port_info = {
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
.irq_flags = IRQF_SHARED,
.chipset = ide_generic,
};

static const char *mac_ide_name[] =
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/palm_bk3710.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ static struct ide_port_info __devinitdata palm_bk3710_port_info = {
.host_flags = IDE_HFLAG_MMIO,
.pio_mask = ATA_PIO4,
.mwdma_mask = ATA_MWDMA2,
.chipset = ide_palm3710,
};

static int __init palm_bk3710_probe(struct platform_device *pdev)
Expand Down Expand Up @@ -363,7 +364,6 @@ static int __init palm_bk3710_probe(struct platform_device *pdev)
(base + IDE_PALM_ATA_PRI_CTL_OFFSET);
hw.irq = irq->start;
hw.dev = &pdev->dev;
hw.chipset = ide_palm3710;

palm_bk3710_port_info.udma_mask = rate < 100000000 ? ATA_UDMA4 :
ATA_UDMA5;
Expand Down
3 changes: 1 addition & 2 deletions drivers/ide/q40ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ static void q40_ide_setup_ports(hw_regs_t *hw, unsigned long base,

hw->irq = irq;
hw->ack_intr = ack_intr;

hw->chipset = ide_generic;
}

static void q40ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd,
Expand Down Expand Up @@ -119,6 +117,7 @@ static const struct ide_port_info q40ide_port_info = {
.tp_ops = &q40ide_tp_ops,
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
.irq_flags = IRQF_SHARED,
.chipset = ide_generic,
};

/*
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/rapide.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

static const struct ide_port_info rapide_port_info = {
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
.chipset = ide_generic,
};

static void rapide_setup_ports(hw_regs_t *hw, void __iomem *base,
Expand Down Expand Up @@ -49,7 +50,6 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)

memset(&hw, 0, sizeof(hw));
rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
hw.chipset = ide_generic;
hw.dev = &ec->dev;

ret = ide_host_add(&rapide_port_info, hws, &host);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/scc_pata.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,6 @@ static int scc_ide_setup_pci_device(struct pci_dev *dev,
hw.io_ports_array[i] = ports->dma + 0x20 + i * 4;
hw.irq = dev->irq;
hw.dev = &dev->dev;
hw.chipset = ide_pci;

rc = ide_host_add(d, hws, &host);
if (rc)
Expand Down Expand Up @@ -823,6 +822,7 @@ static const struct ide_port_info scc_chipset __devinitdata = {
.host_flags = IDE_HFLAG_SINGLE,
.irq_flags = IRQF_SHARED,
.pio_mask = ATA_PIO4,
.chipset = ide_pci,
};

/**
Expand Down
1 change: 0 additions & 1 deletion drivers/ide/setup-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d,

memset(hw, 0, sizeof(*hw));
hw->dev = &dev->dev;
hw->chipset = d->chipset ? d->chipset : ide_pci;
ide_std_init_ports(hw, base, ctl | 2);

return 0;
Expand Down
1 change: 0 additions & 1 deletion drivers/ide/sgiioc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
memset(&hw, 0, sizeof(hw));
sgiioc4_init_hwif_ports(&hw, cmd_base, ctl, irqport);
hw.irq = dev->irq;
hw.chipset = ide_pci;
hw.dev = &dev->dev;

/* Initializing chipset IRQ Registers */
Expand Down
1 change: 0 additions & 1 deletion include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ typedef struct hw_regs_s {

int irq; /* our irq number */
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
hwif_chipset_t chipset;
struct device *dev, *parent;
unsigned long config;
} hw_regs_t;
Expand Down

0 comments on commit 29e52cf

Please sign in to comment.