aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:22 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:22 -0400
commit26042d058ba21305aeb8ac92e4b1483dbec642ac (patch)
tree219ac7061a7c27fb8ca95554cdeb3c0b4d577408 /drivers/ide/ide-probe.c
parent43514ed1ee6a2325692e173ea4eb41068bf72de0 (diff)
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/ide-probe.c')
-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 dea314ce33d3..f3ee098b69c7 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)
949{ 949{
950 int i; 950 int i;
951 951
952 mutex_lock(&ide_cfg_mtx);
952 for (i = 0; i < MAX_DRIVES; i++) { 953 for (i = 0; i < MAX_DRIVES; i++) {
953 ide_drive_t *drive = &hwif->drives[i]; 954 ide_drive_t *drive = &hwif->drives[i];
954 955
@@ -963,6 +964,7 @@ static void ide_port_setup_devices(ide_hwif_t *hwif)
963 964
964 ide_add_drive_to_hwgroup(drive); 965 ide_add_drive_to_hwgroup(drive);
965 } 966 }
967 mutex_unlock(&ide_cfg_mtx);
966} 968}
967 969
968/* 970/*
@@ -1088,8 +1090,6 @@ static int init_irq (ide_hwif_t *hwif)
1088 hwif->sharing_irq ? "shar" : "serializ", match->name); 1090 hwif->sharing_irq ? "shar" : "serializ", match->name);
1089 printk("\n"); 1091 printk("\n");
1090 1092
1091 ide_port_setup_devices(hwif);
1092
1093 mutex_unlock(&ide_cfg_mtx); 1093 mutex_unlock(&ide_cfg_mtx);
1094 return 0; 1094 return 0;
1095out_unlink: 1095out_unlink:
@@ -1447,6 +1447,8 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
1447 continue; 1447 continue;
1448 } 1448 }
1449 1449
1450 ide_port_setup_devices(hwif);
1451
1450 ide_acpi_init(hwif); 1452 ide_acpi_init(hwif);
1451 ide_acpi_port_init_devices(hwif); 1453 ide_acpi_port_init_devices(hwif);
1452 } 1454 }