Messages in this thread | | | Date | Mon, 08 Dec 2008 22:25:48 -0500 | From | Adam M Belay <> | Subject | Re: [PATCH] PNPACPI: Enable Power Support |
| |
Quoting Bjorn Helgaas <bjorn.helgaas@hp.com>: > Hi Adam, > > Do you have any proposals for how pnpacpi_set_resources() should > handle failure? Witold started out with code to call acpi_bus_set_power() > only if the device is power-manageable, and he then passed the > return code up. I suggested letting acpi_bus_set_power() do > the "is-power-manageable" check. But then the caller would have > to distinguish the "device isn't power-manageable" error from > others, which is kind of ugly. > > Bjorn
Hi Bjorn,
How about one of these options:
1.) Modify acpi_bus_set_power() to return success if the device is not power manageable but the request is for D0. After all, any device that doesn't support PM can be assumed to be in D0. (Or maybe more correctly the state of its parent?)
2.) Call acpi_bus_get_power() and check if the state is not already D0 before asking acpi_bus_set_power() for the transition. If it is any other state, then of the device is power manageable.
Thanks, Adam
| |