]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
leds: lp5521: use sysfs_streq()
authorFelipe Balbi <felipe.balbi@nokia.com>
Fri, 13 Feb 2009 22:34:56 +0000 (00:34 +0200)
committerTony Lindgren <tony@atomide.com>
Tue, 17 Feb 2009 23:36:58 +0000 (15:36 -0800)
instead of using strcmp() for comparing strings,
use sysfs_streq().

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/leds/leds-lp5521.c

index b3ba52ab6c452082a9464b7bfc5af6d9111af6fc..3e1ca3129e3e12b8edd7e339d0853561437630f6 100644 (file)
@@ -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);