mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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>
This commit is contained in:
parent
587d1c3c25
commit
81bfbb2d80
1 changed files with 2 additions and 1 deletions
|
@ -17,6 +17,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string_choices.h>
|
||||
|
||||
static LIST_HEAD(container_list);
|
||||
static DEFINE_MUTEX(container_list_lock);
|
||||
|
@ -592,7 +593,7 @@ static ssize_t get_component_power_status(struct device *cdev,
|
|||
if (ecomp->power_status == -1)
|
||||
return (edev->cb->get_power_status) ? -EIO : -ENOTTY;
|
||||
|
||||
return sysfs_emit(buf, "%s\n", ecomp->power_status ? "on" : "off");
|
||||
return sysfs_emit(buf, "%s\n", str_on_off(ecomp->power_status));
|
||||
}
|
||||
|
||||
static ssize_t set_component_power_status(struct device *cdev,
|
||||
|
|
Loading…
Add table
Reference in a new issue