Re: [PATCH]libata-acpi: add ACPI _PSx method

Alan Cox
2007-11-01T10:05:01Z

> + 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