From nobody Sun Sep 22 11:23:49 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89770C433F5 for ; Mon, 14 Feb 2022 06:13:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238383AbiBNGNM (ORCPT ); Mon, 14 Feb 2022 01:13:12 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240818AbiBNGM5 (ORCPT ); Mon, 14 Feb 2022 01:12:57 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A13659A72 for ; Sun, 13 Feb 2022 22:12:28 -0800 (PST) X-UUID: 9a7bd2dcf0dd41049c8f537e789aee7f-20220214 X-UUID: 9a7bd2dcf0dd41049c8f537e789aee7f-20220214 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1806270151; Mon, 14 Feb 2022 14:12:24 +0800 Received: from mtkexhb02.mediatek.inc (172.21.101.103) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Mon, 14 Feb 2022 14:12:23 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb02.mediatek.inc (172.21.101.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 14 Feb 2022 14:12:22 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 14 Feb 2022 14:12:20 +0800 From: Yong Wu To: Greg Kroah-Hartman , David Airlie , Daniel Vetter , CC: James Wang , Liviu Dudau , , Matthias Brugger , Krzysztof Kozlowski , , "Joerg Roedel" , Will Deacon , Arnd Bergmann , Laurent Pinchart , , Chun-Kuang Hu , , "Stephen Boyd" , AngeloGioacchino Del Regno , Hsin-Yi Wang , Robin Murphy , Tomasz Figa , , Rob Clark , Srinivas Kandagatla , Sebastian Reichel , Yong Wu , "Jaroslav Kysela" , Takashi Iwai , Jeremy Szu , Werner Sembach , "Hui Wang" , Cameron Berkenpas , "Kailang Yang" , Lucas Tanure , Sami Loone , Subject: [PATCH 23/23] ALSA: hda/realtek: Make use of the helper component_compare_dev_name Date: Mon, 14 Feb 2022 14:08:19 +0800 Message-ID: <20220214060819.7334-24-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220214060819.7334-1-yong.wu@mediatek.com> References: <20220214060819.7334-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the common compare helper from component. Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Jeremy Szu Cc: Werner Sembach Cc: Hui Wang Cc: Cameron Berkenpas Cc: Kailang Yang Cc: Lucas Tanure Cc: Sami Loone Cc: alsa-devel@alsa-project.org Signed-off-by: Yong Wu --- sound/pci/hda/patch_realtek.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 668274e52674..9da004d99cdb 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -6530,11 +6530,6 @@ static void alc287_fixup_legion_15imhg05_speakers(st= ruct hda_codec *codec, } } =20 -static int comp_match_dev_name(struct device *dev, void *data) -{ - return strcmp(dev_name(dev), data) =3D=3D 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 *c= dc, 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 =3D component_master_add_with_match(dev, &comp_master_ops, spec->mat= ch); if (ret) @@ -6644,9 +6639,9 @@ static void alc287_fixup_legion_16achg6_speakers(stru= ct hda_codec *cdc, const st =20 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 =3D component_master_add_with_match(dev, &comp_master_ops, spec->mat= ch); if (ret) --=20 2.18.0