ide: add ide_device_add()

* Add ide_device_add() helper and convert host drivers to use it
  instead of open-coded variants.

* Make ide_pci_setup_ports() and do_ide_setup_pci_device()
  take 'u8 *idx' argument instead of 'ata_index_t *index'.

* Remove no longer needed ata_index_t.

* Unexport probe_hwif_init() and make it static.

* Unexport ide_proc_register_port().

There should be no functionality changes caused by this patch
(sgiioc4.c: ide_proc_register_port() requires hwif->present
 to be set and it won't be set if probe_hwif_init() fails).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
Bartlomiej Zolnierkiewicz
2007-10-20 00:32:31 +02:00
parent fd9bb53942
commit 8447d9d52a
18 changed files with 92 additions and 138 deletions

View File

@@ -500,6 +500,7 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
{
ide_hwif_t *hwif;
void __iomem *base;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
if (!base)
@@ -523,9 +524,9 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
state->hwif[0] = hwif;
probe_hwif_init(hwif);
idx[0] = hwif->index;
ide_proc_register_port(hwif);
ide_device_add(idx);
return 0;
}
@@ -537,6 +538,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
void __iomem *ioc_base, *easi_base;
unsigned int sel = 0;
int ret;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
if (!ioc_base) {
@@ -608,11 +610,10 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
icside_dma_init(mate);
}
probe_hwif_init(hwif);
probe_hwif_init(mate);
idx[0] = hwif->index;
idx[1] = mate->index;
ide_proc_register_port(hwif);
ide_proc_register_port(mate);
ide_device_add(idx);
return 0;