summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-20 00:32:31 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-20 00:32:31 +0200
commit8447d9d52adbe4c653482bd0d5ccb9b5d26f9c9d (patch)
tree358aa3ca6b0657623b84e7c6278f90fc95a32879 /drivers/ide/ide-probe.c
parentide: add ->fixup method to ide_hwif_t (diff)
downloadlinux-8447d9d52adbe4c653482bd0d5ccb9b5d26f9c9d.tar.xz
linux-8447d9d52adbe4c653482bd0d5ccb9b5d26f9c9d.zip
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>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r--drivers/ide/ide-probe.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index c6ba439b1435..d5146c57e5b3 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -861,7 +861,7 @@ static void probe_hwif(ide_hwif_t *hwif)
static int hwif_init(ide_hwif_t *hwif);
static void hwif_register_devices(ide_hwif_t *hwif);
-int probe_hwif_init(ide_hwif_t *hwif)
+static int probe_hwif_init(ide_hwif_t *hwif)
{
probe_hwif(hwif);
@@ -877,8 +877,6 @@ int probe_hwif_init(ide_hwif_t *hwif)
return 0;
}
-EXPORT_SYMBOL(probe_hwif_init);
-
#if MAX_HWIFS > 1
/*
* save_match() is used to simplify logic in init_irq() below.
@@ -1410,3 +1408,22 @@ int ideprobe_init (void)
}
EXPORT_SYMBOL_GPL(ideprobe_init);
+
+int ide_device_add(u8 idx[4])
+{
+ int i, rc = 0;
+
+ for (i = 0; i < 4; i++) {
+ if (idx[i] != 0xff)
+ rc |= probe_hwif_init(&ide_hwifs[idx[i]]);
+ }
+
+ for (i = 0; i < 4; i++) {
+ if (idx[i] != 0xff)
+ ide_proc_register_port(&ide_hwifs[idx[i]]);
+ }
+
+ return rc;
+}
+
+EXPORT_SYMBOL_GPL(ide_device_add);