From: Felipe Balbi Date: Fri, 13 Feb 2009 22:34:56 +0000 (+0200) Subject: leds: lp5521: use sysfs_streq() X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=1809173fbd1d17951fe697e3f705398ee8eaf7d2;p=linux-2.6-omap-h63xx.git leds: lp5521: use sysfs_streq() instead of using strcmp() for comparing strings, use sysfs_streq(). Signed-off-by: Felipe Balbi Signed-off-by: Tony Lindgren --- diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index b3ba52ab6c4..3e1ca3129e3 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c @@ -352,12 +352,14 @@ static ssize_t store_mode(struct device *dev, mutex_lock(&chip->lock); - if (!strncmp(buf, "run", 3)) + if (sysfs_streq(buf, "run")) lp5521_set_mode(chip, LP5521_MODE_RUN); - else if (!strncmp(buf, "load", 4)) + else if (sysfs_streq(buf, "load")) lp5521_set_mode(chip, LP5521_MODE_LOAD); - else if (!strncmp(buf, "direct", 6)) + else if (sysfs_streq(buf, "direct")) lp5521_set_mode(chip, LP5521_MODE_DIRECT_CONTROL); + else + len = -EINVAL; mutex_unlock(&chip->lock);