ide: fix hwif-s initialization

* Add ide_hwifs[] entry initialization to ide_find_port_slot()
  and remove ide_init_port_data() calls from host drivers.

* Unexport ide_init_port_data().

* Remove no longer needed init_ide_data().
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 9ad54093
...@@ -400,7 +400,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) ...@@ -400,7 +400,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
i = hwif->index; i = hwif->index;
ide_init_port_data(hwif, i);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
default_hwif_mmiops(hwif); default_hwif_mmiops(hwif);
......
...@@ -199,7 +199,6 @@ static int __init h8300_ide_init(void) ...@@ -199,7 +199,6 @@ static int __init h8300_ide_init(void)
} }
index = hwif->index; index = hwif->index;
ide_init_port_data(hwif, index);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
hwif_setup(hwif); hwif_setup(hwif);
hwif->host_flags = IDE_HFLAG_NO_IO_32BIT; hwif->host_flags = IDE_HFLAG_NO_IO_32BIT;
......
...@@ -62,7 +62,6 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) ...@@ -62,7 +62,6 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
u8 index = hwif->index; u8 index = hwif->index;
u8 idx[4] = { index, 0xff, 0xff, 0xff }; u8 idx[4] = { index, 0xff, 0xff, 0xff };
ide_init_port_data(hwif, index);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index); printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index);
......
...@@ -1473,22 +1473,26 @@ ide_hwif_t *ide_find_port_slot(const struct ide_port_info *d) ...@@ -1473,22 +1473,26 @@ ide_hwif_t *ide_find_port_slot(const struct ide_port_info *d)
for (; i < MAX_HWIFS; i++) { for (; i < MAX_HWIFS; i++) {
hwif = &ide_hwifs[i]; hwif = &ide_hwifs[i];
if (hwif->chipset == ide_unknown) if (hwif->chipset == ide_unknown)
return hwif; goto out_found;
} }
} else { } else {
for (i = 2; i < MAX_HWIFS; i++) { for (i = 2; i < MAX_HWIFS; i++) {
hwif = &ide_hwifs[i]; hwif = &ide_hwifs[i];
if (hwif->chipset == ide_unknown) if (hwif->chipset == ide_unknown)
return hwif; goto out_found;
} }
for (i = 0; i < 2 && i < MAX_HWIFS; i++) { for (i = 0; i < 2 && i < MAX_HWIFS; i++) {
hwif = &ide_hwifs[i]; hwif = &ide_hwifs[i];
if (hwif->chipset == ide_unknown) if (hwif->chipset == ide_unknown)
return hwif; goto out_found;
} }
} }
return NULL; return NULL;
out_found:
ide_init_port_data(hwif, i);
return hwif;
} }
EXPORT_SYMBOL_GPL(ide_find_port_slot); EXPORT_SYMBOL_GPL(ide_find_port_slot);
......
...@@ -121,7 +121,6 @@ void ide_init_port_data(ide_hwif_t *hwif, unsigned int index) ...@@ -121,7 +121,6 @@ void ide_init_port_data(ide_hwif_t *hwif, unsigned int index)
ide_port_init_devices_data(hwif); ide_port_init_devices_data(hwif);
} }
EXPORT_SYMBOL_GPL(ide_init_port_data);
static void ide_port_init_devices_data(ide_hwif_t *hwif) static void ide_port_init_devices_data(ide_hwif_t *hwif)
{ {
...@@ -150,18 +149,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif) ...@@ -150,18 +149,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
} }
} }
static void __init init_ide_data (void)
{
unsigned int index;
/* Initialise all interface structures */
for (index = 0; index < MAX_HWIFS; ++index) {
ide_hwif_t *hwif = &ide_hwifs[index];
ide_init_port_data(hwif, index);
}
}
void ide_remove_port_from_hwgroup(ide_hwif_t *hwif) void ide_remove_port_from_hwgroup(ide_hwif_t *hwif)
{ {
ide_hwgroup_t *hwgroup = hwif->hwgroup; ide_hwgroup_t *hwgroup = hwif->hwgroup;
...@@ -1021,8 +1008,6 @@ static int __init ide_init(void) ...@@ -1021,8 +1008,6 @@ static int __init ide_init(void)
goto out_port_class; goto out_port_class;
} }
init_ide_data();
proc_ide_create(); proc_ide_create();
return 0; return 0;
......
...@@ -227,7 +227,6 @@ static int __init buddha_init(void) ...@@ -227,7 +227,6 @@ static int __init buddha_init(void)
if (hwif) { if (hwif) {
u8 index = hwif->index; u8 index = hwif->index;
ide_init_port_data(hwif, index);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
idx[i] = index; idx[i] = index;
......
...@@ -111,7 +111,6 @@ static int __init falconide_init(void) ...@@ -111,7 +111,6 @@ static int __init falconide_init(void)
u8 index = hwif->index; u8 index = hwif->index;
u8 idx[4] = { index, 0xff, 0xff, 0xff }; u8 idx[4] = { index, 0xff, 0xff, 0xff };
ide_init_port_data(hwif, index);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
/* Atari has a byte-swapped IDE interface */ /* Atari has a byte-swapped IDE interface */
......
...@@ -185,7 +185,6 @@ static int __init gayle_init(void) ...@@ -185,7 +185,6 @@ static int __init gayle_init(void)
if (hwif) { if (hwif) {
u8 index = hwif->index; u8 index = hwif->index;
ide_init_port_data(hwif, index);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
idx[i] = index; idx[i] = index;
......
...@@ -187,7 +187,6 @@ static ide_hwif_t *idecs_register(unsigned long io, unsigned long ctl, ...@@ -187,7 +187,6 @@ static ide_hwif_t *idecs_register(unsigned long io, unsigned long ctl,
i = hwif->index; i = hwif->index;
ide_init_port_data(hwif, i);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
hwif->port_ops = &idecs_port_ops; hwif->port_ops = &idecs_port_ops;
......
...@@ -130,7 +130,6 @@ static int __init macide_init(void) ...@@ -130,7 +130,6 @@ static int __init macide_init(void)
u8 index = hwif->index; u8 index = hwif->index;
u8 idx[4] = { index, 0xff, 0xff, 0xff }; u8 idx[4] = { index, 0xff, 0xff, 0xff };
ide_init_port_data(hwif, index);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
ide_device_add(idx, NULL); ide_device_add(idx, NULL);
......
...@@ -142,7 +142,6 @@ static int __init q40ide_init(void) ...@@ -142,7 +142,6 @@ static int __init q40ide_init(void)
hwif = ide_find_port(); hwif = ide_find_port();
if (hwif) { if (hwif) {
ide_init_port_data(hwif, hwif->index);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
/* Q40 has a byte-swapped IDE interface */ /* Q40 has a byte-swapped IDE interface */
......
...@@ -93,7 +93,6 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) ...@@ -93,7 +93,6 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
i = hwif->index; i = hwif->index;
ide_init_port_data(hwif, i);
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
idx[0] = i; idx[0] = i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册