diff options
author | Len Brown <len.brown@intel.com> | 2009-01-09 03:39:43 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-01-09 03:39:43 -0500 |
commit | b2576e1d4408e134e2188c967b1f28af39cd79d4 (patch) | |
tree | 004f3c82faab760f304ce031d6d2f572e7746a50 /drivers/ide/ide-acpi.c | |
parent | 3cc8a5f4ba91f67bbdb81a43a99281a26aab8d77 (diff) | |
parent | 2150edc6c5cf00f7adb54538b9ea2a3e9cedca3f (diff) |
Merge branch 'linus' into release
Diffstat (limited to 'drivers/ide/ide-acpi.c')
-rw-r--r-- | drivers/ide/ide-acpi.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c index 9e8d52a4f306..d8f295bdad76 100644 --- a/drivers/ide/ide-acpi.c +++ b/drivers/ide/ide-acpi.c | |||
@@ -212,7 +212,7 @@ static acpi_handle ide_acpi_hwif_get_handle(ide_hwif_t *hwif) | |||
212 | */ | 212 | */ |
213 | static acpi_handle ide_acpi_drive_get_handle(ide_drive_t *drive) | 213 | static acpi_handle ide_acpi_drive_get_handle(ide_drive_t *drive) |
214 | { | 214 | { |
215 | ide_hwif_t *hwif = HWIF(drive); | 215 | ide_hwif_t *hwif = drive->hwif; |
216 | int port; | 216 | int port; |
217 | acpi_handle drive_handle; | 217 | acpi_handle drive_handle; |
218 | 218 | ||
@@ -257,7 +257,7 @@ static int do_drive_get_GTF(ide_drive_t *drive, | |||
257 | acpi_status status; | 257 | acpi_status status; |
258 | struct acpi_buffer output; | 258 | struct acpi_buffer output; |
259 | union acpi_object *out_obj; | 259 | union acpi_object *out_obj; |
260 | ide_hwif_t *hwif = HWIF(drive); | 260 | ide_hwif_t *hwif = drive->hwif; |
261 | struct device *dev = hwif->gendev.parent; | 261 | struct device *dev = hwif->gendev.parent; |
262 | int err = -ENODEV; | 262 | int err = -ENODEV; |
263 | int port; | 263 | int port; |
@@ -609,10 +609,10 @@ void ide_acpi_push_timing(ide_hwif_t *hwif) | |||
609 | in_params[0].buffer.length = sizeof(struct GTM_buffer); | 609 | in_params[0].buffer.length = sizeof(struct GTM_buffer); |
610 | in_params[0].buffer.pointer = (u8 *)&hwif->acpidata->gtm; | 610 | in_params[0].buffer.pointer = (u8 *)&hwif->acpidata->gtm; |
611 | in_params[1].type = ACPI_TYPE_BUFFER; | 611 | in_params[1].type = ACPI_TYPE_BUFFER; |
612 | in_params[1].buffer.length = sizeof(ATA_ID_WORDS * 2); | 612 | in_params[1].buffer.length = ATA_ID_WORDS * 2; |
613 | in_params[1].buffer.pointer = (u8 *)&master->idbuff; | 613 | in_params[1].buffer.pointer = (u8 *)&master->idbuff; |
614 | in_params[2].type = ACPI_TYPE_BUFFER; | 614 | in_params[2].type = ACPI_TYPE_BUFFER; |
615 | in_params[2].buffer.length = sizeof(ATA_ID_WORDS * 2); | 615 | in_params[2].buffer.length = ATA_ID_WORDS * 2; |
616 | in_params[2].buffer.pointer = (u8 *)&slave->idbuff; | 616 | in_params[2].buffer.pointer = (u8 *)&slave->idbuff; |
617 | /* Output buffer: _STM has no output */ | 617 | /* Output buffer: _STM has no output */ |
618 | 618 | ||
@@ -635,7 +635,8 @@ void ide_acpi_push_timing(ide_hwif_t *hwif) | |||
635 | */ | 635 | */ |
636 | void ide_acpi_set_state(ide_hwif_t *hwif, int on) | 636 | void ide_acpi_set_state(ide_hwif_t *hwif, int on) |
637 | { | 637 | { |
638 | int unit; | 638 | ide_drive_t *drive; |
639 | int i; | ||
639 | 640 | ||
640 | if (ide_noacpi || ide_noacpi_psx) | 641 | if (ide_noacpi || ide_noacpi_psx) |
641 | return; | 642 | return; |
@@ -649,9 +650,8 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on) | |||
649 | /* channel first and then drives for power on and verse versa for power off */ | 650 | /* channel first and then drives for power on and verse versa for power off */ |
650 | if (on) | 651 | if (on) |
651 | acpi_bus_set_power(hwif->acpidata->obj_handle, ACPI_STATE_D0); | 652 | acpi_bus_set_power(hwif->acpidata->obj_handle, ACPI_STATE_D0); |
652 | for (unit = 0; unit < MAX_DRIVES; ++unit) { | ||
653 | ide_drive_t *drive = &hwif->drives[unit]; | ||
654 | 653 | ||
654 | ide_port_for_each_dev(i, drive, hwif) { | ||
655 | if (!drive->acpidata->obj_handle) | 655 | if (!drive->acpidata->obj_handle) |
656 | drive->acpidata->obj_handle = ide_acpi_drive_get_handle(drive); | 656 | drive->acpidata->obj_handle = ide_acpi_drive_get_handle(drive); |
657 | 657 | ||
@@ -705,15 +705,13 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif) | |||
705 | * for both drives, regardless whether they are connected | 705 | * for both drives, regardless whether they are connected |
706 | * or not. | 706 | * or not. |
707 | */ | 707 | */ |
708 | hwif->drives[0].acpidata = &hwif->acpidata->master; | 708 | hwif->devices[0]->acpidata = &hwif->acpidata->master; |
709 | hwif->drives[1].acpidata = &hwif->acpidata->slave; | 709 | hwif->devices[1]->acpidata = &hwif->acpidata->slave; |
710 | 710 | ||
711 | /* | 711 | /* |
712 | * Send IDENTIFY for each drive | 712 | * Send IDENTIFY for each drive |
713 | */ | 713 | */ |
714 | for (i = 0; i < MAX_DRIVES; i++) { | 714 | ide_port_for_each_dev(i, drive, hwif) { |
715 | drive = &hwif->drives[i]; | ||
716 | |||
717 | memset(drive->acpidata, 0, sizeof(*drive->acpidata)); | 715 | memset(drive->acpidata, 0, sizeof(*drive->acpidata)); |
718 | 716 | ||
719 | if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) | 717 | if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) |
@@ -738,9 +736,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif) | |||
738 | ide_acpi_get_timing(hwif); | 736 | ide_acpi_get_timing(hwif); |
739 | ide_acpi_push_timing(hwif); | 737 | ide_acpi_push_timing(hwif); |
740 | 738 | ||
741 | for (i = 0; i < MAX_DRIVES; i++) { | 739 | ide_port_for_each_dev(i, drive, hwif) { |
742 | drive = &hwif->drives[i]; | ||
743 | |||
744 | if (drive->dev_flags & IDE_DFLAG_PRESENT) | 740 | if (drive->dev_flags & IDE_DFLAG_PRESENT) |
745 | /* Execute ACPI startup code */ | 741 | /* Execute ACPI startup code */ |
746 | ide_acpi_exec_tfs(drive); | 742 | ide_acpi_exec_tfs(drive); |