sysfs.c (1da177e4c3f41524e886b7f1b8a0c1fc7321cac2) | sysfs.c (74880c063b06efd103c924abfe19d9d8fa4864c4) |
---|---|
1/* 2 * drivers/base/power/sysfs.c - sysfs entries for device PM 3 */ 4 5#include <linux/device.h> 6#include "power.h" 7 8 --- 10 unchanged lines hidden (view full) --- 19 * state (via its driver's ->suspend() method). 20 * If the device is currently in a low-power state, and the value is 0, 21 * the device is powered back on (via the ->resume() method). 22 * If the device is in a low-power state, and a different low-power state 23 * is requested, the device is first resumed, then suspended into the new 24 * low-power state. 25 */ 26 | 1/* 2 * drivers/base/power/sysfs.c - sysfs entries for device PM 3 */ 4 5#include <linux/device.h> 6#include "power.h" 7 8 --- 10 unchanged lines hidden (view full) --- 19 * state (via its driver's ->suspend() method). 20 * If the device is currently in a low-power state, and the value is 0, 21 * the device is powered back on (via the ->resume() method). 22 * If the device is in a low-power state, and a different low-power state 23 * is requested, the device is first resumed, then suspended into the new 24 * low-power state. 25 */ 26 |
27static ssize_t state_show(struct device * dev, char * buf) | 27static ssize_t state_show(struct device * dev, struct device_attribute *attr, char * buf) |
28{ 29 return sprintf(buf, "%u\n", dev->power.power_state); 30} 31 | 28{ 29 return sprintf(buf, "%u\n", dev->power.power_state); 30} 31 |
32static ssize_t state_store(struct device * dev, const char * buf, size_t n) | 32static ssize_t state_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t n) |
33{ 34 u32 state; 35 char * rest; 36 int error = 0; 37 38 state = simple_strtoul(buf, &rest, 10); 39 if (*rest) 40 return -EINVAL; --- 28 unchanged lines hidden --- | 33{ 34 u32 state; 35 char * rest; 36 int error = 0; 37 38 state = simple_strtoul(buf, &rest, 10); 39 if (*rest) 40 return -EINVAL; --- 28 unchanged lines hidden --- |