aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-acpi.c')
-rw-r--r--drivers/ide/ide-acpi.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index fd155b8a256c..2f9e941968d6 100644
--- a/drivers/ide/ide-acpi.c
+++ b/drivers/ide/ide-acpi.c
@@ -641,7 +641,8 @@ void ide_acpi_push_timing(ide_hwif_t *hwif)
641 */ 641 */
642void ide_acpi_set_state(ide_hwif_t *hwif, int on) 642void ide_acpi_set_state(ide_hwif_t *hwif, int on)
643{ 643{
644 int unit; 644 ide_drive_t *drive;
645 int i;
645 646
646 if (ide_noacpi || ide_noacpi_psx) 647 if (ide_noacpi || ide_noacpi_psx)
647 return; 648 return;
@@ -655,9 +656,8 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on)
655 /* channel first and then drives for power on and verse versa for power off */ 656 /* channel first and then drives for power on and verse versa for power off */
656 if (on) 657 if (on)
657 acpi_bus_set_power(hwif->acpidata->obj_handle, ACPI_STATE_D0); 658 acpi_bus_set_power(hwif->acpidata->obj_handle, ACPI_STATE_D0);
658 for (unit = 0; unit < MAX_DRIVES; ++unit) {
659 ide_drive_t *drive = hwif->devices[unit];
660 659
660 ide_port_for_each_dev(i, drive, hwif) {
661 if (!drive->acpidata->obj_handle) 661 if (!drive->acpidata->obj_handle)
662 drive->acpidata->obj_handle = ide_acpi_drive_get_handle(drive); 662 drive->acpidata->obj_handle = ide_acpi_drive_get_handle(drive);
663 663
@@ -717,9 +717,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif)
717 /* 717 /*
718 * Send IDENTIFY for each drive 718 * Send IDENTIFY for each drive
719 */ 719 */
720 for (i = 0; i < MAX_DRIVES; i++) { 720 ide_port_for_each_dev(i, drive, hwif) {
721 drive = hwif->devices[i];
722
723 memset(drive->acpidata, 0, sizeof(*drive->acpidata)); 721 memset(drive->acpidata, 0, sizeof(*drive->acpidata));
724 722
725 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) 723 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
@@ -744,9 +742,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif)
744 ide_acpi_get_timing(hwif); 742 ide_acpi_get_timing(hwif);
745 ide_acpi_push_timing(hwif); 743 ide_acpi_push_timing(hwif);
746 744
747 for (i = 0; i < MAX_DRIVES; i++) { 745 ide_port_for_each_dev(i, drive, hwif) {
748 drive = hwif->devices[i];
749
750 if (drive->dev_flags & IDE_DFLAG_PRESENT) 746 if (drive->dev_flags & IDE_DFLAG_PRESENT)
751 /* Execute ACPI startup code */ 747 /* Execute ACPI startup code */
752 ide_acpi_exec_tfs(drive); 748 ide_acpi_exec_tfs(drive);