Skip to contentSkip to conversation

/sys/power/state contents

DISCUSSION Johannes Berg 3 participants 5 messages Apr 29, 2006 – May 2, 2006

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
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??

#2 lore raw
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

#3 lore raw
In reply to David Brownell
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

#4 lore raw
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.