Message ID | 20221008065934.308408-1-ye.xingchen@zte.com.cn |
---|---|
State | New |
Headers | show |
Series | [linux-next] leds: leds-bd2802: replace strcmp with sysfs_streq | expand |
diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c index 2b6678f6bd56..cbbda0cccf46 100644 --- a/drivers/leds/leds-bd2802.c +++ b/drivers/leds/leds-bd2802.c @@ -451,9 +451,9 @@ static ssize_t bd2802_store_adv_conf(struct device *dev, return -EINVAL; down_write(&led->rwsem); - if (!led->adf_on && !strncmp(buf, "on", 2)) + if (!led->adf_on && sysfs_streq(buf, "on")) bd2802_enable_adv_conf(led); - else if (led->adf_on && !strncmp(buf, "off", 3)) + else if (led->adf_on && sysfs_streq(buf, "off")) bd2802_disable_adv_conf(led); up_write(&led->rwsem);