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

driver core: location: Use str_yes_no() helper function

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

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250211132409.700073-2-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Thorsten Blum and committed by
Greg Kroah-Hartman
1d2d45b6 177cbd52

+3 -2
+3 -2
drivers/base/physical_location.c
··· 7 7 8 8 #include <linux/acpi.h> 9 9 #include <linux/sysfs.h> 10 + #include <linux/string_choices.h> 10 11 11 12 #include "physical_location.h" 12 13 ··· 117 116 char *buf) 118 117 { 119 118 return sysfs_emit(buf, "%s\n", 120 - dev->physical_location->dock ? "yes" : "no"); 119 + str_yes_no(dev->physical_location->dock)); 121 120 } 122 121 static DEVICE_ATTR_RO(dock); 123 122 ··· 125 124 char *buf) 126 125 { 127 126 return sysfs_emit(buf, "%s\n", 128 - dev->physical_location->lid ? "yes" : "no"); 127 + str_yes_no(dev->physical_location->lid)); 129 128 } 130 129 static DEVICE_ATTR_RO(lid); 131 130