> + max_devices = ata_link_max_devices(&ap->link); > + > + for (i = 0; i < max_devices; ++i) { > + struct ata_device *dev = &ap->link.device[i]; Better to use: ata_link_for_each_dev(dev, &ap->link) { > + > + if (dev->acpi_handle) > + acpi_bus_set_power(dev->acpi_handle, > + state.event == PM_EVENT_ON ? > + ACPI_STATE_D0: ACPI_STATE_D3); > + } Also should you not check ata_dev_enabled(dev) ? Alan - To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html