Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: enclosure: Use str_on_off() helper

Remove hard-coded strings by using the str_on_off() helper.

Signed-off-by: Yumeng Fang <fang.yumeng@zte.com.cn>
Link: https://lore.kernel.org/r/20250623202944425TQzPdeMtYA8qRtlrnwiR8@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Yumeng Fang and committed by
Greg Kroah-Hartman
81bfbb2d 587d1c3c

+2 -1
+2 -1
drivers/misc/enclosure.c
··· 17 17 #include <linux/module.h> 18 18 #include <linux/mutex.h> 19 19 #include <linux/slab.h> 20 + #include <linux/string_choices.h> 20 21 21 22 static LIST_HEAD(container_list); 22 23 static DEFINE_MUTEX(container_list_lock); ··· 593 592 if (ecomp->power_status == -1) 594 593 return (edev->cb->get_power_status) ? -EIO : -ENOTTY; 595 594 596 - return sysfs_emit(buf, "%s\n", ecomp->power_status ? "on" : "off"); 595 + return sysfs_emit(buf, "%s\n", str_on_off(ecomp->power_status)); 597 596 } 598 597 599 598 static ssize_t set_component_power_status(struct device *cdev,