ALSA: hda - Pass printf argument directly to request_module()
[firefly-linux-kernel-4.4.55.git] / sound / pci / hda / hda_codec.c
index 15e0089492f735f55814d6caf1e6735080358602..0025bf4c2f44ba92d0c4084053c153c0128edb6f 100644 (file)
@@ -966,14 +966,12 @@ find_codec_preset(struct hda_codec *codec)
        mutex_unlock(&preset_mutex);
 
        if (mod_requested < HDA_MODREQ_MAX_COUNT) {
-               char name[32];
                if (!mod_requested)
-                       snprintf(name, sizeof(name), "snd-hda-codec-id:%08x",
-                                codec->vendor_id);
+                       request_module("snd-hda-codec-id:%08x",
+                                      codec->vendor_id);
                else
-                       snprintf(name, sizeof(name), "snd-hda-codec-id:%04x*",
-                                (codec->vendor_id >> 16) & 0xffff);
-               request_module(name);
+                       request_module("snd-hda-codec-id:%04x*",
+                                      (codec->vendor_id >> 16) & 0xffff);
                mod_requested++;
                goto again;
        }
@@ -2927,16 +2925,8 @@ static int vmaster_mute_mode_info(struct snd_kcontrol *kcontrol,
        static const char * const texts[] = {
                "On", "Off", "Follow Master"
        };
-       unsigned int index;
 
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
-       uinfo->count = 1;
-       uinfo->value.enumerated.items = 3;
-       index = uinfo->value.enumerated.item;
-       if (index >= 3)
-               index = 2;
-       strcpy(uinfo->value.enumerated.name, texts[index]);
-       return 0;
+       return snd_ctl_enum_info(uinfo, 1, 3, texts);
 }
 
 static int vmaster_mute_mode_get(struct snd_kcontrol *kcontrol,
@@ -5195,14 +5185,7 @@ int snd_hda_enum_helper_info(struct snd_kcontrol *kcontrol,
                texts = texts_default;
        }
 
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
-       uinfo->count = 1;
-       uinfo->value.enumerated.items = num_items;
-       if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
-               uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
-       strcpy(uinfo->value.enumerated.name,
-              texts[uinfo->value.enumerated.item]);
-       return 0;
+       return snd_ctl_enum_info(uinfo, 1, num_items, texts);
 }
 EXPORT_SYMBOL_GPL(snd_hda_enum_helper_info);