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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index 2427c380b3dc..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
@@ -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 }