From patchwork Sat Jul 13 01:51:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shenghao Ding X-Patchwork-Id: 812629 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B7B1C3DA4B for ; Sat, 13 Jul 2024 01:53:08 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4D33E9F6; Sat, 13 Jul 2024 03:52:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4D33E9F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1720835586; bh=2MX1KLXTFjNfOMVjTG0kdwRapO48u9jmWDGEz+kukcw=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Z3k5ql9inwB7ehkD+niCA2Cr6VyPDKx4RI3NJDXucPsXdeM4lIkUcq1RSUcFKqg2u PXenjzJib+Uq32KydJR/AymvY0Y/m97RD9YUBCFBS5fu5kFrjneAP9LAEjxhI+B9DE epjA4d1j8ZwNtmNLLGiDMUtYxbqKxPyC7ji7+Cvg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 44915F805D2; Sat, 13 Jul 2024 03:52:29 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id CE227F805B5; Sat, 13 Jul 2024 03:52:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 354E3F801F5; Sat, 13 Jul 2024 03:52:24 +0200 (CEST) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 128A8F800FA for ; Sat, 13 Jul 2024 03:52:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 128A8F800FA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=LIMkLRdp Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 46D1qEXT054732; Fri, 12 Jul 2024 20:52:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1720835534; bh=12zvunMgJ4BHmV2ehOmR6esUYfYMaau/21+alSU86Jc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=LIMkLRdpfW2d5jdSSAUA3V2OfuLJBGo2Lz2ZXJI3PJqyuBfUEGsMVCHdXSON3tOmb cb7p84kfQgKNqllOEvcbw3dWqAGSPJQCmLQ5IIARMoQRS8M8fyWAKFRUQV7GIhMN0K mOykiP9BTFWUT2bq813EtJ2BxrMBVS1rj0wJqGMU= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 46D1qEct012773 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 12 Jul 2024 20:52:14 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 12 Jul 2024 20:52:13 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE111.ent.ti.com (157.170.170.22) 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; Fri, 12 Jul 2024 20:52:13 -0500 Received: from LT5CG31242FY.dhcp.ti.com ([10.250.160.245]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 46D1pnOs126053; Fri, 12 Jul 2024 20:52:03 -0500 From: Shenghao Ding To: CC: , , , , <13916275206@139.com>, , , , , , , , , , , , , , , , , , , , , , , , , Shenghao Ding Subject: [PATCH v1 2/2] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 Date: Sat, 13 Jul 2024 09:51:42 +0800 Message-ID: <20240713015145.314-2-shenghao-ding@ti.com> X-Mailer: git-send-email 2.33.0.windows.2 In-Reply-To: <20240713015145.314-1-shenghao-ding@ti.com> References: <20240713015145.314-1-shenghao-ding@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Message-ID-Hash: F2QPH7OA5OQEMVXWTWADO7LNKPTIRDRG X-Message-ID-Hash: F2QPH7OA5OQEMVXWTWADO7LNKPTIRDRG X-MailFrom: shenghao-ding@ti.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Rename dai_driver name to unify the name between TAS2563 and TAS2781, remove unnecessary line feed, strscpy replace scnprintf. Signed-off-by: Shenghao Ding v1: - Use strscpy to replace scnprintf. - rename dai_driver name from "tas2781_codec" to "tasdev_codec" - Remove unnecessary line feed for tasdevice_dsp_create_ctrls --- sound/soc/codecs/tas2781-i2c.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/tas2781-i2c.c b/sound/soc/codecs/tas2781-i2c.c index e79d613745b4..6482ec44f7a8 100644 --- a/sound/soc/codecs/tas2781-i2c.c +++ b/sound/soc/codecs/tas2781-i2c.c @@ -352,7 +352,7 @@ static int tasdevice_create_control(struct tasdevice_priv *tas_priv) ret = -ENOMEM; goto out; } - scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "Speaker Profile Id"); + strscpy(name, "Speaker Profile Id", SNDRV_CTL_ELEM_ID_NAME_MAXLEN); prof_ctrls[mix_index].name = name; prof_ctrls[mix_index].iface = SNDRV_CTL_ELEM_IFACE_MIXER; prof_ctrls[mix_index].info = tasdevice_info_profile; @@ -423,8 +423,7 @@ static int tasdevice_configuration_put( return ret; } -static int tasdevice_dsp_create_ctrls( - struct tasdevice_priv *tas_priv) +static int tasdevice_dsp_create_ctrls(struct tasdevice_priv *tas_priv) { struct snd_kcontrol_new *dsp_ctrls; char *prog_name, *conf_name; @@ -452,8 +451,8 @@ static int tasdevice_dsp_create_ctrls( goto out; } - scnprintf(prog_name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, - "Speaker Program Id"); + strscpy(prog_name, "Speaker Program Id", + SNDRV_CTL_ELEM_ID_NAME_MAXLEN); dsp_ctrls[mix_index].name = prog_name; dsp_ctrls[mix_index].iface = SNDRV_CTL_ELEM_IFACE_MIXER; dsp_ctrls[mix_index].info = tasdevice_info_programs; @@ -461,8 +460,7 @@ static int tasdevice_dsp_create_ctrls( dsp_ctrls[mix_index].put = tasdevice_program_put; mix_index++; - scnprintf(conf_name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, - "Speaker Config Id"); + strscpy(conf_name, "Speaker Config Id", SNDRV_CTL_ELEM_ID_NAME_MAXLEN); dsp_ctrls[mix_index].name = conf_name; dsp_ctrls[mix_index].iface = SNDRV_CTL_ELEM_IFACE_MIXER; dsp_ctrls[mix_index].info = tasdevice_info_configurations; @@ -672,7 +670,7 @@ static const struct snd_soc_dai_ops tasdevice_dai_ops = { static struct snd_soc_dai_driver tasdevice_dai_driver[] = { { - .name = "tas2781_codec", + .name = "tasdev_codec", .id = 0, .playback = { .stream_name = "Playback",