Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbb010c1 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: drop 'initializing' argument from ide_register_hw()



* Rename init_hwif_data() to ide_init_port_data() and export it.

* For all users of ide_register_hw() with 'initializing' argument set
  hwif->present and hwif->hold are always zero so convert these host
  drivers to use ide_find_port()+ide_init_port_data()+ide_init_port_hw()
  instead (also no need for init_hwif_default() call since the setup
  done by it gets over-ridden by ide_init_port_hw() call).

* Drop 'initializing' argument from ide_register_hw().

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 57c802e8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ bastide_register(unsigned int base, unsigned int aux, int irq,
	hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
	hw.irq = irq;

	ide_register_hw(&hw, NULL, 0, hwif);
	ide_register_hw(&hw, NULL, hwif);

	return 0;
}
+7 −1
Original line number Diff line number Diff line
@@ -26,10 +26,16 @@

void __init ide_arm_init(void)
{
	ide_hwif_t *hwif;
	hw_regs_t hw;

	memset(&hw, 0, sizeof(hw));
	ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
	hw.irq = IDE_ARM_IRQ;
	ide_register_hw(&hw, NULL, 1, NULL);

	hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
	if (hwif) {
		ide_init_port_data(hwif, hwif->index);
		ide_init_port_hw(hwif, &hw);
	}
}
+3 −1
Original line number Diff line number Diff line
@@ -777,9 +777,11 @@ init_e100_ide (void)
		                ide_offsets,
		                0, 0, cris_ide_ack_intr,
		                ide_default_irq(0));
		ide_register_hw(&hw, NULL, 1, &hwif);
		hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
		if (hwif == NULL)
			continue;
		ide_init_port_data(hwif, hwif->index);
		ide_init_port_hw(hwif, &hw);
		hwif->mmio = 1;
		hwif->chipset = ide_etrax100;
		hwif->set_pio_mode = &cris_set_pio_mode;
+7 −4
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ void __init h8300_ide_init(void)
{
	hw_regs_t hw;
	ide_hwif_t *hwif;
	int idx;
	int index;

	if (!request_region(CONFIG_H8300_IDE_BASE, H8300_IDE_GAP*8, "ide-h8300"))
		goto out_busy;
@@ -100,14 +100,17 @@ void __init h8300_ide_init(void)
	hw_setup(&hw);

	/* register if */
	idx = ide_register_hw(&hw, NULL, 1, &hwif);
	if (idx == -1) {
	hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
	if (hwif == NULL) {
		printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
		return;
	}

	index = hwif->index;
	ide_init_port_data(hwif, index);
	ide_init_port_hw(hwif, &hw);
	hwif_setup(hwif);
	printk(KERN_INFO "ide%d: H8/300 generic IDE interface\n", idx);
	printk(KERN_INFO "ide%d: H8/300 generic IDE interface\n", index);
	return;

out_busy:
+7 −4
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
{
	hw_regs_t hw;
	ide_hwif_t *hwif;
	int index;

	if (!(pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) && pnp_irq_valid(dev, 0)))
		return -1;
@@ -41,9 +40,13 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id
				pnp_port_start(dev, 1));
	hw.irq = pnp_irq(dev, 0);

	index = ide_register_hw(&hw, NULL, 1, &hwif);
	hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
	if (hwif) {
		u8 index = hwif->index;

		ide_init_port_data(hwif, index);
		ide_init_port_hw(hwif, &hw);

	if (index != -1) {
		printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index);
		pnp_set_drvdata(dev,hwif);
		return 0;
Loading