diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-08 17:02:50 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-08 17:02:57 +0200 |
commit | ff96e612cba32510e263e17b213235fe5746397e (patch) | |
tree | a8df57d76b10e0901a4fb76cd2987eb9826a560a /drivers/regulator/virtual.c | |
parent | cd84a42f315e50edd454c27a3da3951ccd3d735a (diff) | |
parent | 577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff) | |
download | blackbird-op-linux-ff96e612cba32510e263e17b213235fe5746397e.tar.gz blackbird-op-linux-ff96e612cba32510e263e17b213235fe5746397e.zip |
Merge commit 'v2.6.30-rc1' into core/urgent
Merge reason: need latest upstream to queue up dependent fix
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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, unsigned int mode; int ret; - if (strncmp(buf, "fast", strlen("fast")) == 0) + /* + * sysfs_streq() doesn't need the \n's, but we add them so the strings + * will be shared with show_mode(), above. + */ + if (sysfs_streq(buf, "fast\n") == 0) mode = REGULATOR_MODE_FAST; - else if (strncmp(buf, "normal", strlen("normal")) == 0) + else if (sysfs_streq(buf, "normal\n") == 0) mode = REGULATOR_MODE_NORMAL; - else if (strncmp(buf, "idle", strlen("idle")) == 0) + else if (sysfs_streq(buf, "idle\n") == 0) mode = REGULATOR_MODE_IDLE; - else if (strncmp(buf, "standby", strlen("standby")) == 0) + else if (sysfs_streq(buf, "standby\n") == 0) mode = REGULATOR_MODE_STANDBY; else { dev_err(dev, "Configuring invalid mode\n"); @@ -256,7 +260,7 @@ static DEVICE_ATTR(min_microamps, 0666, show_min_uA, set_min_uA); static DEVICE_ATTR(max_microamps, 0666, show_max_uA, set_max_uA); static DEVICE_ATTR(mode, 0666, show_mode, set_mode); -struct device_attribute *attributes[] = { +static struct device_attribute *attributes[] = { &dev_attr_min_microvolts, &dev_attr_max_microvolts, &dev_attr_min_microamps, |