From patchwork Thu Sep 15 13:45:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 9333673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D9676077A for ; Thu, 15 Sep 2016 13:49:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08251296C2 for ; Thu, 15 Sep 2016 13:49:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0D65297BD; Thu, 15 Sep 2016 13:49:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3FC5296C2 for ; Thu, 15 Sep 2016 13:49:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7C674266EC5; Thu, 15 Sep 2016 15:48:58 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0D6B8261A5E; Thu, 15 Sep 2016 15:46:20 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C72B8266EB4; Thu, 15 Sep 2016 15:46:02 +0200 (CEST) Received: from smtp-proxy003.phy.lolipop.jp (smtp-proxy003.phy.lolipop.jp [157.7.104.44]) by alsa0.perex.cz (Postfix) with ESMTP id 596E9261A5E for ; Thu, 15 Sep 2016 15:45:55 +0200 (CEST) Received: from smtp-proxy003.phy.lolipop.lan (HELO smtp-proxy003.phy.lolipop.jp) (172.19.44.44) (smtp-auth username m12129643-o-takashi, mechanism plain) by smtp-proxy003.phy.lolipop.jp (qpsmtpd/0.82) with ESMTPA; Thu, 15 Sep 2016 22:45:53 +0900 Received: from 127.0.0.1 (127.0.0.1) by smtp-proxy003.phy.lolipop.jp (LOLIPOP-Fsecure); Thu, 15 Sep 2016 22:45:49 +0900 (JST) X-Virus-Status: clean(LOLIPOP-Fsecure) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Thu, 15 Sep 2016 22:45:49 +0900 Message-Id: <1473947149-6663-1-git-send-email-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.7.4 Cc: vinod.koul@intel.com, alsa-devel@alsa-project.org, ckeepax@opensource.wolfsonmicro.com, broonie@linaro.org Subject: [alsa-devel] [PATCH] Revert "ASoC: core: mark SND_SOC_BYTES_EXT as deprecated" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP SND_SOC_BYTES_TLV brings confusions to user land because it doesn't follow to a protocol of ctl and tlv operation. At least, this macro and related kernel APIs include two misunderstandings: - 'struct snd_ctl_elem_info.count' can also represent the length of TLV packet paylaod, snd_soc_bytes_info_ext() performs in this way. - 'struct snd_ctl_tlv.tlv' can include arbitrary data regardless of TLV packet structure, snd_soc_bytes_tlv_callback() performs in this way. In a policy of kernel land development, it's quite worse to break protocols for applications. Therefore, developers are discouraged to use these kernel APIs. In the first place, SND_SOC_BYTES_TLV was added to satisfy a request of developers who need to add control elements which transfer data larger than the size which 'struct snd_ctl_elem_value' can represent; e.g. over 512 bytes. However, as long as the size is less than the size; e.g. 512 bytes, SND_SOC_BYTES_EXT is still available. Although there is actually the limitation of maximum data size, it's better to use this API for stable application interface till better alternative ways are implemented in future. For these reasons, this commit reverts the previous commit which lead developers to the worse behaviour. Signed-off-by: Takashi Sakamoto Acked-by: Charles Keepax --- include/sound/soc.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 6144882..18f7d21 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -311,9 +311,6 @@ {.base = xbase, .num_regs = xregs, \ .mask = xmask }) } -/* - * SND_SOC_BYTES_EXT is deprecated, please USE SND_SOC_BYTES_TLV instead - */ #define SND_SOC_BYTES_EXT(xname, xcount, xhandler_get, xhandler_put) \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ .info = snd_soc_bytes_info_ext, \