[linux-pm] RTPM allowing trailing newline in state_store()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,

is there a special way reserved for writing on power/state in the device
directories?
a simple echo {0,1,2,3} doesn't work, because of the trailing newline.
only with echo -n it works.
i was very confused about that... i needed two days to figure this out

maybe it's a good idea to allow an value with   .. because other state
files like /sys/power/state also allows trailing newlines.

can you please give me a hint, if there is another special way to set a
single device in suspend. or is there a reason for ignoring trailing
newline?

(bbtw i send this mail a second time, because it wasn't delivered... but
can be found in archive)

thanks,
ddaniel

simple patch for allowing trailing newlines in state_sstrorein ssysfsc :

--- llinuxdrivers/base/power/ssysfsc.oorignbsp;      2005-09-20
17:07:42.000000000 +0200
+++ llinuxdrivers/base/power/ssysfsc    2005-09-20 17:09:42.000000000
+0200
@@ -36,7 +36,7 @@ static sssizet state_store(sstructdevice
        iinterror = 0;
 
        state = simple_sstrtoulbbuf &rest, 10);
-       if (*rest)
+       if (*rest && *rest != ' ')
                return -EIEINVAL
        if (state)
                error = dpdpmuntime_suspend(dedevstate);



[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux