Skip to content

Commit

Permalink
ide: move ide_port_setup_devices() call to ide_device_add_all()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Apr 17, 2008
1 parent 43514ed commit 26042d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -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);
}

/*
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 26042d0

Please sign in to comment.