/sys/power/state contents
Why does it say:
* show() returns what states are supported, which is hard-coded to * 'standby' (Power-On Suspend), 'mem' (Suspend-to-RAM), and * 'disk' (Suspend-to-Disk).
and not use the ->valid call to limit what is displayed to what can be entered?
johannes
Quoted 7 lines · Johannes Berg
Why does it say:
* show() returns what states are supported, which is hard-coded to * 'standby' (Power-On Suspend), 'mem' (Suspend-to-RAM), and * 'disk' (Suspend-to-Disk).and not use the ->valid call to limit what is displayed to what can be entered?
You mean, exactly like the valid_state() function already does??
Quoted 4 lines · David Brownell
Quoted 2 lines
and not use the ->valid call to limit what is displayed to what can be entered?
You mean, exactly like the
valid_state()function already does??
Eh, my apologies. I had indeed missed the call in the if there. Sorry.
johannes
Quoted 1 line · David Brownell
You mean, exactly like the
valid_state()function already does??
Which actually opens up another question. Why is the default 1 instead of 0? If an arch doesn't have any callbacks, why announce that it can do it? It would seem more sensible to me to force an arch that wants to support this to also have a valid call in order to announce it. Not that it actually will work, but why even show it?
johannes
Quoted 9 lines · Johannes Berg
Quoted 1 line · David Brownell
You mean, exactly like the
valid_state()function already does??Which actually opens up another question. Why is the default 1 instead of 0? If an arch doesn't have any callbacks, why announce that it can do it? It would seem more sensible to me to force an arch that wants to support this to also have a valid call in order to announce it. Not that it actually will work, but why even show it?
Historical reasons.
Pavel
Signature · 1 line
Thanks for all the (sleeping) penguins.