aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/regulator/virtual.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c
index 5ddb464b1c3f..a38d42bc8f8f 100644
--- a/drivers/regulator/virtual.c
+++ b/drivers/regulator/virtual.c
@@ -226,13 +226,13 @@ 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 if (sysfs_streq(buf, "fast\n") == 0)
230 mode = REGULATOR_MODE_FAST; 230 mode = REGULATOR_MODE_FAST;
231 else if (strncmp(buf, "normal", strlen("normal")) == 0) 231 else if (sysfs_streq(buf, "normal\n") == 0)
232 mode = REGULATOR_MODE_NORMAL; 232 mode = REGULATOR_MODE_NORMAL;
233 else if (strncmp(buf, "idle", strlen("idle")) == 0) 233 else if (sysfs_streq(buf, "idle\n") == 0)
234 mode = REGULATOR_MODE_IDLE; 234 mode = REGULATOR_MODE_IDLE;
235 else if (strncmp(buf, "standby", strlen("standby")) == 0) 235 else if (sysfs_streq(buf, "standby\n") == 0)
236 mode = REGULATOR_MODE_STANDBY; 236 mode = REGULATOR_MODE_STANDBY;
237 else { 237 else {
238 dev_err(dev, "Configuring invalid mode\n"); 238 dev_err(dev, "Configuring invalid mode\n");