ALSA: hda/realtek: Make use of the helper component_compare_dev_name
authorYong Wu <yong.wu@mediatek.com>
Mon, 14 Feb 2022 06:08:19 +0000 (14:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Feb 2022 11:16:14 +0000 (12:16 +0100)
Use the common compare helper from component.

Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Jeremy Szu <jeremy.szu@canonical.com>
Cc: Werner Sembach <wse@tuxedocomputers.com>
Cc: Hui Wang <hui.wang@canonical.com>
Cc: Cameron Berkenpas <cam@neo-zeon.de>
Cc: Kailang Yang <kailang@realtek.com>
Cc: Lucas Tanure <tanureal@opensource.cirrus.com>
Cc: Sami Loone <sami@loone.fi>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Link: https://lore.kernel.org/r/20220214060819.7334-24-yong.wu@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/patch_realtek.c

index 668274e52674591b843df7f2256a962046ad6fde..9da004d99cdbe79fa772a67db67f706847185e78 100644 (file)
@@ -6530,11 +6530,6 @@ static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
        }
 }
 
-static int comp_match_dev_name(struct device *dev, void *data)
-{
-       return strcmp(dev_name(dev), data) == 0;
-}
-
 static int find_comp_by_dev_name(struct alc_spec *spec, const char *name)
 {
        int i;
@@ -6595,7 +6590,7 @@ static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char
                                              "%s-%s:00-cs35l41-hda.%d", bus, hid, i);
                        if (!name)
                                return;
-                       component_match_add(dev, &spec->match, comp_match_dev_name, name);
+                       component_match_add(dev, &spec->match, component_compare_dev_name, name);
                }
                ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
                if (ret)
@@ -6644,9 +6639,9 @@ static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const st
 
        switch (action) {
        case HDA_FIXUP_ACT_PRE_PROBE:
-               component_match_add(dev, &spec->match, comp_match_dev_name,
+               component_match_add(dev, &spec->match, component_compare_dev_name,
                                    "i2c-CLSA0100:00-cs35l41-hda.0");
-               component_match_add(dev, &spec->match, comp_match_dev_name,
+               component_match_add(dev, &spec->match, component_compare_dev_name,
                                    "i2c-CLSA0100:00-cs35l41-hda.1");
                ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
                if (ret)