diff mbox series

[linux-next] leds: leds-bd2802: replace strcmp with sysfs_streq

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

Commit Message

yexingchen116@gmail.com Oct. 8, 2022, 6:59 a.m. UTC
From: ye xingchen <ye.xingchen@zte.com.cn>

Replace the open-code with sysfs_streq().

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 drivers/leds/leds-bd2802.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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);