From patchwork Tue Mar 18 08:02:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 3847601 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9069DBF540 for ; Tue, 18 Mar 2014 08:04:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C419B201EF for ; Tue, 18 Mar 2014 08:04:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9345620142 for ; Tue, 18 Mar 2014 08:04:49 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AEE42265208; Tue, 18 Mar 2014 09:04:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 3DAD5261B0B; Tue, 18 Mar 2014 09:02:08 +0100 (CET) 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 A3AF3262600; Tue, 18 Mar 2014 09:02:07 +0100 (CET) Received: from smtp-out-224.synserver.de (smtp-out-230.synserver.de [212.40.185.230]) by alsa0.perex.cz (Postfix) with ESMTP id E1774261B0B for ; Tue, 18 Mar 2014 09:01:44 +0100 (CET) Received: (qmail 31179 invoked by uid 0); 18 Mar 2014 08:01:42 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 30698 Received: from ppp-46-244-130-51.dynamic.mnet-online.de (HELO lars-adi-laptop.fritz.box) [46.244.130.51] by 217.119.54.81 with SMTP; 18 Mar 2014 08:01:40 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Tue, 18 Mar 2014 09:02:08 +0100 Message-Id: <1395129736-11938-6-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1395129736-11938-1-git-send-email-lars@metafoo.de> References: <1395129736-11938-1-git-send-email-lars@metafoo.de> Cc: Brian Austin , Lars-Peter Clausen , patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org, Paul Handrigan , Kuninori Morimoto , Peter Ujfalusi , Maxime Ripard , Charles Keepax Subject: [alsa-devel] [PATCH 05/13] ASoC: Drop ASoC level caching from hw_write/hw_read 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 All drivers using these functions now do regmap level caching. So this is dead code and can be removed. Signed-off-by: Lars-Peter Clausen --- sound/soc/soc-io.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c index de1e496..a66bc17 100644 --- a/sound/soc/soc-io.c +++ b/sound/soc/soc-io.c @@ -167,44 +167,16 @@ EXPORT_SYMBOL_GPL(snd_soc_platform_write); static int hw_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int value) { - int ret; - - if (!snd_soc_codec_volatile_register(codec, reg) && - reg < codec->driver->reg_cache_size && - !codec->cache_bypass) { - ret = snd_soc_cache_write(codec, reg, value); - if (ret < 0) - return -1; - } - - if (codec->cache_only) { - codec->cache_sync = 1; - return 0; - } - return regmap_write(codec->control_data, reg, value); } static unsigned int hw_read(struct snd_soc_codec *codec, unsigned int reg) { - int ret; unsigned int val; + int ret; - if (reg >= codec->driver->reg_cache_size || - snd_soc_codec_volatile_register(codec, reg) || - codec->cache_bypass) { - if (codec->cache_only) - return -1; - - ret = regmap_read(codec->control_data, reg, &val); - if (ret == 0) - return val; - else - return -1; - } - - ret = snd_soc_cache_read(codec, reg, &val); - if (ret < 0) + ret = regmap_read(codec->control_data, reg, &val); + if (ret != 0) return -1; return val; }