Skip to content

Commit 9e1ee33

Browse files
tobluxDominik Brodowski
authored andcommitted
pcmcia: Use str_off_on() and str_yes_no() helpers
Remove hard-coded strings by using the str_off_on() and str_yes_no() helper functions. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
1 parent 4bf1541 commit 9e1ee33

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/pcmcia/socket_sysfs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/init.h>
1111
#include <linux/kernel.h>
1212
#include <linux/string.h>
13+
#include <linux/string_choices.h>
1314
#include <linux/major.h>
1415
#include <linux/errno.h>
1516
#include <linux/mm.h>
@@ -98,7 +99,7 @@ static ssize_t pccard_show_card_pm_state(struct device *dev,
9899
char *buf)
99100
{
100101
struct pcmcia_socket *s = to_socket(dev);
101-
return sysfs_emit(buf, "%s\n", s->state & SOCKET_SUSPEND ? "off" : "on");
102+
return sysfs_emit(buf, "%s\n", str_off_on(s->state & SOCKET_SUSPEND));
102103
}
103104

104105
static ssize_t pccard_store_card_pm_state(struct device *dev,
@@ -177,7 +178,7 @@ static ssize_t pccard_show_resource(struct device *dev,
177178
struct device_attribute *attr, char *buf)
178179
{
179180
struct pcmcia_socket *s = to_socket(dev);
180-
return sysfs_emit(buf, "%s\n", s->resource_setup_done ? "yes" : "no");
181+
return sysfs_emit(buf, "%s\n", str_yes_no(s->resource_setup_done));
181182
}
182183

183184
static ssize_t pccard_store_resource(struct device *dev,

0 commit comments

Comments
 (0)