Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4217080pxf; Tue, 16 Mar 2021 08:15:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiPUtO7jCyf7X8kX9YReGDzYVoHIPoX2NOX++FzqFsOVcXvfPg2DFZLHuMJBkdkT2qHPUV X-Received: by 2002:a17:906:12db:: with SMTP id l27mr29814628ejb.500.1615907728142; Tue, 16 Mar 2021 08:15:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615907728; cv=none; d=google.com; s=arc-20160816; b=WXNf8x8D8LtsywAo+fvr7WDX4PAWbG2AsF5MxaKv0LWWIvor8oSbO2LxRQYSnSxQo6 sCIoJTm67kptC3WIm2aeL5YpVT+8OU4cz6th9HI346i7HSGQrGQO6USQCG/4pDJVg9mw zEK30qicUS1uzc9568yxFK/UMoEN7Msjq209YZ3NifPjHiF7SZXlShp2oGZ8Zwqos2L8 NdVqcVD9yENyHY7+gXKjKd2do0QwzoVK194c5PFzQCAS7cW//N+pBLLho+dmHTU0sR28 sQrDS7ukgNcu7uT8dIHQzlLOlaeCn0azQQHDbIvz+JB04804efqM88Ask9XRCZLK4KSv tIyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=Dr+jybfkSUSdmHsCKowC7M1s9rkOFOFAqYplpkhZuhM=; b=th4f5wFi3D+J5+iiA+VVcxQvGjGNRXhg6VaiO+GFaY1H9u4oeJDfp2ZH5k/XlThvN2 zYkSplYPTc3TGmBKAmS/OAi3+ptDVqyPM5sgobhc/xldYEN90ueRM5Bj58u2CGpvq7Ul bxhbPL14kghFGiCOadayvOkHxP+3hTdq4rwOGnNMX3OxzJZ5hPKe+TWkW1oWC3hsgTgW ZK2xEnlpdXVFPCu4PFPNHRo1EKY/x1IQ1DQO++0LWjW/Br1Y1KCGujDuuTlmFtc+3F1r FTg0P+RezDXYEITBWD9oL7pgPSN09d5isMitM9u5o8/ZcvfX2UvzKRp5k+mCrRgXZzRJ sZ5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm20si7694739edb.120.2021.03.16.08.15.05; Tue, 16 Mar 2021 08:15:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236444AbhCPJ4T (ORCPT + 99 others); Tue, 16 Mar 2021 05:56:19 -0400 Received: from inva020.nxp.com ([92.121.34.13]:50372 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236422AbhCPJzh (ORCPT ); Tue, 16 Mar 2021 05:55:37 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A33FD1A3FC1; Tue, 16 Mar 2021 10:55:35 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id CDA631A3FAB; Tue, 16 Mar 2021 10:55:29 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id A0B3340291; Tue, 16 Mar 2021 10:55:22 +0100 (CET) From: Shengjiu Wang To: timur@kernel.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: fsl_spdif: use snd_ctl_boolean_mono_info Date: Tue, 16 Mar 2021 17:42:16 +0800 Message-Id: <1615887736-31217-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Viorel Suman Remove redundant code and use snd_ctl_boolean_mono_info instead. Signed-off-by: Viorel Suman Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_spdif.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 174e558224d8..1cd3441d1c03 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -801,18 +801,6 @@ static int fsl_spdif_qget(struct snd_kcontrol *kcontrol, return ret; } -/* Valid bit information */ -static int fsl_spdif_vbit_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) -{ - uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; - uinfo->count = 1; - uinfo->value.integer.min = 0; - uinfo->value.integer.max = 1; - - return 0; -} - /* Get valid good bit from interrupt status register */ static int fsl_spdif_rx_vbit_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) @@ -925,18 +913,6 @@ static int fsl_spdif_rxrate_get(struct snd_kcontrol *kcontrol, return 0; } -/* User bit sync mode info */ -static int fsl_spdif_usync_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) -{ - uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; - uinfo->count = 1; - uinfo->value.integer.min = 0; - uinfo->value.integer.max = 1; - - return 0; -} - /* * User bit sync mode: * 1 CD User channel subcode @@ -1018,7 +994,7 @@ static struct snd_kcontrol_new fsl_spdif_ctrls[] = { .name = "IEC958 RX V-Bit Errors", .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, - .info = fsl_spdif_vbit_info, + .info = snd_ctl_boolean_mono_info, .get = fsl_spdif_rx_vbit_get, }, { @@ -1027,7 +1003,7 @@ static struct snd_kcontrol_new fsl_spdif_ctrls[] = { .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE | SNDRV_CTL_ELEM_ACCESS_VOLATILE, - .info = fsl_spdif_vbit_info, + .info = snd_ctl_boolean_mono_info, .get = fsl_spdif_tx_vbit_get, .put = fsl_spdif_tx_vbit_put, }, @@ -1047,7 +1023,7 @@ static struct snd_kcontrol_new fsl_spdif_ctrls[] = { .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_WRITE | SNDRV_CTL_ELEM_ACCESS_VOLATILE, - .info = fsl_spdif_usync_info, + .info = snd_ctl_boolean_mono_info, .get = fsl_spdif_usync_get, .put = fsl_spdif_usync_put, }, -- 2.27.0