From nobody Sun Feb 8 21:29:23 2026 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 6511EC71153 for ; Mon, 4 Sep 2023 14:02:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345262AbjIDOCd (ORCPT ); Mon, 4 Sep 2023 10:02:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235816AbjIDOCc (ORCPT ); Mon, 4 Sep 2023 10:02:32 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1457EC for ; Mon, 4 Sep 2023 07:02:28 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 384E1pY9032394; Mon, 4 Sep 2023 09:01:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1693836111; bh=VIoUxI9w1YlS9QHCYycHmC3ae7maFlvtb/dFKMgd0oM=; h=From:To:CC:Subject:Date; b=V7sbK3iasp2Pc6i1SBoXjIzvGns65XjqzFDHQvtcvWN+uHMnoLv0Y4kn4gwROT9i7 Jt/01W40vx9W1zQuwlYd0MAvNy4YIyrKLCq0TIr3kXuevJTDLPQAwn5l/S4P065veG 07sC+v94yi+au8KAZBHsgqvJgl3795WGXF/LyzK4= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 384E1pKU031062 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Sep 2023 09:01:51 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 4 Sep 2023 09:01:50 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 4 Sep 2023 09:01:51 -0500 Received: from LT5CG31242FY.dhcp.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 384E1inc046392; Mon, 4 Sep 2023 09:01:45 -0500 From: Shenghao Ding To: CC: , , , , , , <13916275206@139.com>, , , , , , , , , , , Shenghao Ding Subject: [PATCH v2] ALSA: hda/tas2781: Revert structure name back to cs35l41_dev_name Date: Mon, 4 Sep 2023 22:01:40 +0800 Message-ID: <20230904140140.1253-1-shenghao-ding@ti.com> X-Mailer: git-send-email 2.33.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Revert structure name back to cs35l41_dev_name and redefine tas2781_generic_fixup. Signed-off-by: Shenghao Ding --- Changes in v2: - Add more description on why revert structure name back to cs35l41_dev_name - Redefine tas2781_generic_fixup, remove hid argument, and do not use structure scodec_dev_name any more in tas2781_generic_fixup. - remove cs35l41_dev_name from comp_match_tas2781_dev_name, which is useless. bus name is passed by tas2781_generic_fixup, hid is actually "TIAS2781", can be hardcode and unneeded argument passed from tas2781_generic_fixup. Index is a redundant member, and never used in tas2781 hda driver. - revert from scodec_dev_name back to cs35l41_dev_name, tas2781 pass only bus name instead of cs35l41_dev_name, so it seemed unnecessary for tas2781. --- sound/pci/hda/patch_realtek.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a07df6f929..c3e410152b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -6745,7 +6745,7 @@ static void comp_generic_playback_hook(struct hda_pcm= _stream *hinfo, struct hda_ } } =20 -struct scodec_dev_name { +struct cs35l41_dev_name { const char *bus; const char *hid; int index; @@ -6754,7 +6754,7 @@ struct scodec_dev_name { /* match the device name in a slightly relaxed manner */ static int comp_match_cs35l41_dev_name(struct device *dev, void *data) { - struct scodec_dev_name *p =3D data; + struct cs35l41_dev_name *p =3D data; const char *d =3D dev_name(dev); int n =3D strlen(p->bus); char tmp[32]; @@ -6773,19 +6773,19 @@ static int comp_match_cs35l41_dev_name(struct devic= e *dev, void *data) static int comp_match_tas2781_dev_name(struct device *dev, void *data) { - struct scodec_dev_name *p =3D data; + const char *bus =3D data; const char *d =3D dev_name(dev); - int n =3D strlen(p->bus); + int n =3D strlen(bus); char tmp[32]; =20 /* check the bus name */ - if (strncmp(d, p->bus, n)) + if (strncmp(d, bus, n)) return 0; /* skip the bus number */ if (isdigit(d[n])) n++; /* the rest must be exact matching */ - snprintf(tmp, sizeof(tmp), "-%s:00", p->hid); + snprintf(tmp, sizeof(tmp), "-%s:00", "TIAS2781"); =20 return !strcmp(d + n, tmp); } @@ -6795,7 +6795,7 @@ static void cs35l41_generic_fixup(struct hda_codec *c= dc, int action, const char { struct device *dev =3D hda_codec_dev(cdc); struct alc_spec *spec =3D cdc->spec; - struct scodec_dev_name *rec; + struct cs35l41_dev_name *rec; int ret, i; =20 switch (action) { @@ -6824,24 +6824,17 @@ static void cs35l41_generic_fixup(struct hda_codec = *cdc, int action, const char } =20 static void tas2781_generic_fixup(struct hda_codec *cdc, int action, - const char *bus, const char *hid) + const char *bus) { struct device *dev =3D hda_codec_dev(cdc); struct alc_spec *spec =3D cdc->spec; - struct scodec_dev_name *rec; int ret; =20 switch (action) { case HDA_FIXUP_ACT_PRE_PROBE: - rec =3D devm_kmalloc(dev, sizeof(*rec), GFP_KERNEL); - if (!rec) - return; - rec->bus =3D bus; - rec->hid =3D hid; - rec->index =3D 0; spec->comps[0].codec =3D cdc; component_match_add(dev, &spec->match, - comp_match_tas2781_dev_name, rec); + comp_match_tas2781_dev_name, (void *)bus); ret =3D component_master_add_with_match(dev, &comp_master_ops, spec->match); if (ret) @@ -6888,7 +6881,7 @@ static void alc287_fixup_legion_16ithg6_speakers(stru= ct hda_codec *cdc, const st static void tas2781_fixup_i2c(struct hda_codec *cdc, const struct hda_fixup *fix, int action) { - tas2781_generic_fixup(cdc, action, "i2c", "TIAS2781"); + tas2781_generic_fixup(cdc, action, "i2c"); } =20 /* for alc295_fixup_hp_top_speakers */ --=20 2.34.1