]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda: Simplify with str_enable_disable()
authorTakashi Iwai <tiwai@suse.de>
Tue, 7 Jan 2025 15:56:37 +0000 (16:56 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 7 Jan 2025 16:35:36 +0000 (17:35 +0100)
Use the standard helper str_enable_disable() to simplify the code.
Only code refactoring, no behavior change.

Link: https://patch.msgid.link/20250107155641.4435-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/hda/hdac_component.c

index bb37e7e0bd790c0156c5807f44848fd2f44271cd..9c82a2864a2fbe2fd06bc6c21541d9a8b8ffbdf8 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/component.h>
+#include <linux/string_choices.h>
 #include <sound/core.h>
 #include <sound/hdaudio.h>
 #include <sound/hda_component.h>
@@ -42,8 +43,7 @@ int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable)
        if (!acomp->ops->codec_wake_override)
                return 0;
 
-       dev_dbg(bus->dev, "%s codec wakeup\n",
-               enable ? "enable" : "disable");
+       dev_dbg(bus->dev, "%s codec wakeup\n", str_enable_disable(enable));
 
        acomp->ops->codec_wake_override(acomp->dev, enable);
 
@@ -67,8 +67,7 @@ void snd_hdac_display_power(struct hdac_bus *bus, unsigned int idx, bool enable)
 {
        struct drm_audio_component *acomp = bus->audio_component;
 
-       dev_dbg(bus->dev, "display power %s\n",
-               enable ? "enable" : "disable");
+       dev_dbg(bus->dev, "display power %s\n", str_enable_disable(enable));
 
        mutex_lock(&bus->lock);
        if (enable)