diff options
Diffstat (limited to 'drivers/ide/ide-acpi.c')
-rw-r--r-- | drivers/ide/ide-acpi.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c index 6f704628c27d..244a8a052ce8 100644 --- a/drivers/ide/ide-acpi.c +++ b/drivers/ide/ide-acpi.c | |||
@@ -290,7 +290,7 @@ static int do_drive_get_GTF(ide_drive_t *drive, | |||
290 | DEBPRINT("ENTER: %s at %s, port#: %d, hard_port#: %d\n", | 290 | DEBPRINT("ENTER: %s at %s, port#: %d, hard_port#: %d\n", |
291 | hwif->name, dev->bus_id, port, hwif->channel); | 291 | hwif->name, dev->bus_id, port, hwif->channel); |
292 | 292 | ||
293 | if (!drive->present) { | 293 | if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) { |
294 | DEBPRINT("%s drive %d:%d not present\n", | 294 | DEBPRINT("%s drive %d:%d not present\n", |
295 | hwif->name, hwif->channel, port); | 295 | hwif->name, hwif->channel, port); |
296 | goto out; | 296 | goto out; |
@@ -420,8 +420,9 @@ static int do_drive_set_taskfiles(ide_drive_t *drive, | |||
420 | 420 | ||
421 | DEBPRINT("ENTER: %s, hard_port#: %d\n", drive->name, drive->dn); | 421 | DEBPRINT("ENTER: %s, hard_port#: %d\n", drive->name, drive->dn); |
422 | 422 | ||
423 | if (!drive->present) | 423 | if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) |
424 | goto out; | 424 | goto out; |
425 | |||
425 | if (!gtf_count) /* shouldn't be here */ | 426 | if (!gtf_count) /* shouldn't be here */ |
426 | goto out; | 427 | goto out; |
427 | 428 | ||
@@ -584,7 +585,7 @@ void ide_acpi_get_timing(ide_hwif_t *hwif) | |||
584 | * This function executes the _STM ACPI method for the target channel. | 585 | * This function executes the _STM ACPI method for the target channel. |
585 | * | 586 | * |
586 | * _STM requires Identify Drive data, which has to passed as an argument. | 587 | * _STM requires Identify Drive data, which has to passed as an argument. |
587 | * Unfortunately hd_driveid is a mangled version which we can't readily | 588 | * Unfortunately drive->id is a mangled version which we can't readily |
588 | * use; hence we'll get the information afresh. | 589 | * use; hence we'll get the information afresh. |
589 | */ | 590 | */ |
590 | void ide_acpi_push_timing(ide_hwif_t *hwif) | 591 | void ide_acpi_push_timing(ide_hwif_t *hwif) |
@@ -614,10 +615,10 @@ void ide_acpi_push_timing(ide_hwif_t *hwif) | |||
614 | in_params[0].buffer.length = sizeof(struct GTM_buffer); | 615 | in_params[0].buffer.length = sizeof(struct GTM_buffer); |
615 | in_params[0].buffer.pointer = (u8 *)&hwif->acpidata->gtm; | 616 | in_params[0].buffer.pointer = (u8 *)&hwif->acpidata->gtm; |
616 | in_params[1].type = ACPI_TYPE_BUFFER; | 617 | in_params[1].type = ACPI_TYPE_BUFFER; |
617 | in_params[1].buffer.length = sizeof(struct hd_driveid); | 618 | in_params[1].buffer.length = sizeof(ATA_ID_WORDS * 2); |
618 | in_params[1].buffer.pointer = (u8 *)&master->idbuff; | 619 | in_params[1].buffer.pointer = (u8 *)&master->idbuff; |
619 | in_params[2].type = ACPI_TYPE_BUFFER; | 620 | in_params[2].type = ACPI_TYPE_BUFFER; |
620 | in_params[2].buffer.length = sizeof(struct hd_driveid); | 621 | in_params[2].buffer.length = sizeof(ATA_ID_WORDS * 2); |
621 | in_params[2].buffer.pointer = (u8 *)&slave->idbuff; | 622 | in_params[2].buffer.pointer = (u8 *)&slave->idbuff; |
622 | /* Output buffer: _STM has no output */ | 623 | /* Output buffer: _STM has no output */ |
623 | 624 | ||
@@ -660,7 +661,8 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on) | |||
660 | if (!drive->acpidata->obj_handle) | 661 | if (!drive->acpidata->obj_handle) |
661 | drive->acpidata->obj_handle = ide_acpi_drive_get_handle(drive); | 662 | drive->acpidata->obj_handle = ide_acpi_drive_get_handle(drive); |
662 | 663 | ||
663 | if (drive->acpidata->obj_handle && drive->present) { | 664 | if (drive->acpidata->obj_handle && |
665 | (drive->dev_flags & IDE_DFLAG_PRESENT)) { | ||
664 | acpi_bus_set_power(drive->acpidata->obj_handle, | 666 | acpi_bus_set_power(drive->acpidata->obj_handle, |
665 | on? ACPI_STATE_D0: ACPI_STATE_D3); | 667 | on? ACPI_STATE_D0: ACPI_STATE_D3); |
666 | } | 668 | } |
@@ -720,7 +722,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif) | |||
720 | 722 | ||
721 | memset(drive->acpidata, 0, sizeof(*drive->acpidata)); | 723 | memset(drive->acpidata, 0, sizeof(*drive->acpidata)); |
722 | 724 | ||
723 | if (!drive->present) | 725 | if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) |
724 | continue; | 726 | continue; |
725 | 727 | ||
726 | err = taskfile_lib_get_identify(drive, drive->acpidata->idbuff); | 728 | err = taskfile_lib_get_identify(drive, drive->acpidata->idbuff); |
@@ -745,7 +747,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif) | |||
745 | for (i = 0; i < MAX_DRIVES; i++) { | 747 | for (i = 0; i < MAX_DRIVES; i++) { |
746 | drive = &hwif->drives[i]; | 748 | drive = &hwif->drives[i]; |
747 | 749 | ||
748 | if (drive->present) | 750 | if (drive->dev_flags & IDE_DFLAG_PRESENT) |
749 | /* Execute ACPI startup code */ | 751 | /* Execute ACPI startup code */ |
750 | ide_acpi_exec_tfs(drive); | 752 | ide_acpi_exec_tfs(drive); |
751 | } | 753 | } |