summaryrefslogtreecommitdiff
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-18 00:46:22 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-18 00:46:22 +0200
commit26042d058ba21305aeb8ac92e4b1483dbec642ac (patch)
tree219ac7061a7c27fb8ca95554cdeb3c0b4d577408 /drivers/ide
parent43514ed1ee6a2325692e173ea4eb41068bf72de0 (diff)
downloadlinux-3.10-26042d058ba21305aeb8ac92e4b1483dbec642ac.tar.gz
linux-3.10-26042d058ba21305aeb8ac92e4b1483dbec642ac.tar.bz2
linux-3.10-26042d058ba21305aeb8ac92e4b1483dbec642ac.zip
ide: move ide_port_setup_devices() call to ide_device_add_all()
Add ide_cfg_mtx lock/unlock to ide_port_setup_devices() and then move ide_port_setup_devices() call from init_irq() to ide_device_add_all(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-probe.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index dea314ce33d..f3ee098b69c 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -949,6 +949,7 @@ static void ide_port_setup_devices(ide_hwif_t *hwif)
{
int i;
+ mutex_lock(&ide_cfg_mtx);
for (i = 0; i < MAX_DRIVES; i++) {
ide_drive_t *drive = &hwif->drives[i];
@@ -963,6 +964,7 @@ static void ide_port_setup_devices(ide_hwif_t *hwif)
ide_add_drive_to_hwgroup(drive);
}
+ mutex_unlock(&ide_cfg_mtx);
}
/*
@@ -1088,8 +1090,6 @@ static int init_irq (ide_hwif_t *hwif)
hwif->sharing_irq ? "shar" : "serializ", match->name);
printk("\n");
- ide_port_setup_devices(hwif);
-
mutex_unlock(&ide_cfg_mtx);
return 0;
out_unlink:
@@ -1447,6 +1447,8 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
continue;
}
+ ide_port_setup_devices(hwif);
+
ide_acpi_init(hwif);
ide_acpi_port_init_devices(hwif);
}