Re: [RESEND PATCH] pcmcia: Use str_off_on() and str_yes_no() helpers

From: Dominik Brodowski
Date: Sat Aug 16 2025 - 10:53:16 EST


Applied to pcmcia-next, thanks.

Best,
Dominik

Am Fri, Apr 11, 2025 at 10:44:29AM +0200 schrieb Thorsten Blum:
> Remove hard-coded strings by using the str_off_on() and str_yes_no()
> helper functions.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> drivers/pcmcia/socket_sysfs.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pcmcia/socket_sysfs.c b/drivers/pcmcia/socket_sysfs.c
> index c7a906664c36..4eadd0485066 100644
> --- a/drivers/pcmcia/socket_sysfs.c
> +++ b/drivers/pcmcia/socket_sysfs.c
> @@ -10,6 +10,7 @@
> #include <linux/init.h>
> #include <linux/kernel.h>
> #include <linux/string.h>
> +#include <linux/string_choices.h>
> #include <linux/major.h>
> #include <linux/errno.h>
> #include <linux/mm.h>
> @@ -98,7 +99,7 @@ static ssize_t pccard_show_card_pm_state(struct device *dev,
> char *buf)
> {
> struct pcmcia_socket *s = to_socket(dev);
> - return sysfs_emit(buf, "%s\n", s->state & SOCKET_SUSPEND ? "off" : "on");
> + return sysfs_emit(buf, "%s\n", str_off_on(s->state & SOCKET_SUSPEND));
> }
>
> static ssize_t pccard_store_card_pm_state(struct device *dev,
> @@ -177,7 +178,7 @@ static ssize_t pccard_show_resource(struct device *dev,
> struct device_attribute *attr, char *buf)
> {
> struct pcmcia_socket *s = to_socket(dev);
> - return sysfs_emit(buf, "%s\n", s->resource_setup_done ? "yes" : "no");
> + return sysfs_emit(buf, "%s\n", str_yes_no(s->resource_setup_done));
> }
>
> static ssize_t pccard_store_resource(struct device *dev,
> --
> 2.49.0
>
>