linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] leds: leds-bd2802: replace strcmp with sysfs_streq
@ 2022-10-08  6:59 yexingchen116
  0 siblings, 0 replies; only message in thread
From: yexingchen116 @ 2022-10-08  6:59 UTC (permalink / raw)
  To: pavel; +Cc: linux-leds, linux-kernel, ye xingchen

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-08  6:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08  6:59 [PATCH linux-next] leds: leds-bd2802: replace strcmp with sysfs_streq yexingchen116

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).