diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-03 13:39:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-03 13:39:20 -0400 |
commit | 18b34b9546dc192d978dda940673f40928d2e36e (patch) | |
tree | ca396840ed95fc46cd360c68bf2cefe5ab4cbda8 /drivers/regulator/virtual.c | |
parent | ca1ee219c070eab755712d50638bbcd1f8630fc1 (diff) | |
parent | d6bb69cfa88b8ac9f952de4fada5b216d5ba8830 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (32 commits)
regulator: twl4030 VAUX3 supports 3.0V
regulator: Support disabling of unused regulators by machines
regulator: Don't increment use_count for boot_on regulators
twl4030-regulator: expose VPLL2
regulator: refcount fixes
regulator: Don't warn if we failed to get a regulator
regulator: Allow boot_on regulators to be disabled by clients
regulator: Implement list_voltage for WM835x LDOs and DCDCs
twl4030-regulator: list more VAUX4 voltages
regulator: Don't warn on omitted voltage constraints
regulator: Implement list_voltage() for WM8400 DCDCs and LDOs
MMC: regulator utilities
regulator: twl4030 voltage enumeration (v2)
regulator: twl4030 regulators
regulator: get_status() grows kerneldoc
regulator: enumerate voltages (v2)
regulator: Fix get_mode() for WM835x DCDCs
regulator: Allow regulators to set the initial operating mode
regulator: Suggest use of datasheet supply or pin names for consumers
regulator: email - update email address and regulator webpage.
...
Diffstat (limited to 'drivers/regulator/virtual.c')
-rw-r--r-- | drivers/regulator/virtual.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c index 5ddb464b1c3f..3d08348584e1 100644 --- a/drivers/regulator/virtual.c +++ b/drivers/regulator/virtual.c | |||
@@ -226,13 +226,17 @@ static ssize_t set_mode(struct device *dev, struct device_attribute *attr, | |||
226 | unsigned int mode; | 226 | unsigned int mode; |
227 | int ret; | 227 | int ret; |
228 | 228 | ||
229 | if (strncmp(buf, "fast", strlen("fast")) == 0) | 229 | /* |
230 | * sysfs_streq() doesn't need the \n's, but we add them so the strings | ||
231 | * will be shared with show_mode(), above. | ||
232 | */ | ||
233 | if (sysfs_streq(buf, "fast\n") == 0) | ||
230 | mode = REGULATOR_MODE_FAST; | 234 | mode = REGULATOR_MODE_FAST; |
231 | else if (strncmp(buf, "normal", strlen("normal")) == 0) | 235 | else if (sysfs_streq(buf, "normal\n") == 0) |
232 | mode = REGULATOR_MODE_NORMAL; | 236 | mode = REGULATOR_MODE_NORMAL; |
233 | else if (strncmp(buf, "idle", strlen("idle")) == 0) | 237 | else if (sysfs_streq(buf, "idle\n") == 0) |
234 | mode = REGULATOR_MODE_IDLE; | 238 | mode = REGULATOR_MODE_IDLE; |
235 | else if (strncmp(buf, "standby", strlen("standby")) == 0) | 239 | else if (sysfs_streq(buf, "standby\n") == 0) |
236 | mode = REGULATOR_MODE_STANDBY; | 240 | mode = REGULATOR_MODE_STANDBY; |
237 | else { | 241 | else { |
238 | dev_err(dev, "Configuring invalid mode\n"); | 242 | dev_err(dev, "Configuring invalid mode\n"); |
@@ -256,7 +260,7 @@ static DEVICE_ATTR(min_microamps, 0666, show_min_uA, set_min_uA); | |||
256 | static DEVICE_ATTR(max_microamps, 0666, show_max_uA, set_max_uA); | 260 | static DEVICE_ATTR(max_microamps, 0666, show_max_uA, set_max_uA); |
257 | static DEVICE_ATTR(mode, 0666, show_mode, set_mode); | 261 | static DEVICE_ATTR(mode, 0666, show_mode, set_mode); |
258 | 262 | ||
259 | struct device_attribute *attributes[] = { | 263 | static struct device_attribute *attributes[] = { |
260 | &dev_attr_min_microvolts, | 264 | &dev_attr_min_microvolts, |
261 | &dev_attr_max_microvolts, | 265 | &dev_attr_max_microvolts, |
262 | &dev_attr_min_microamps, | 266 | &dev_attr_min_microamps, |