From patchwork Thu Jan 12 10:47:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 9512979 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 8079560710 for ; Thu, 12 Jan 2017 10:58:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74234286A8 for ; Thu, 12 Jan 2017 10:58:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68D8B286BF; Thu, 12 Jan 2017 10:58:16 +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 083DE286A8 for ; Thu, 12 Jan 2017 10:58:14 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6EF11266A51; Thu, 12 Jan 2017 11:58:11 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E57022666B3; Thu, 12 Jan 2017 11:55:52 +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 82F532669BD; Thu, 12 Jan 2017 11:46:38 +0100 (CET) Received: from www.osadl.org (www.osadl.org [62.245.132.105]) by alsa0.perex.cz (Postfix) with ESMTP id 30725266725 for ; Thu, 12 Jan 2017 11:46:33 +0100 (CET) Received: from debian01.hofrr.at (92-243-34-74.adsl.nanet.at [92.243.34.74] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id v0CAkPGj003579; Thu, 12 Jan 2017 11:46:28 +0100 From: Nicholas Mc Guire To: Bard Liao Date: Thu, 12 Jan 2017 11:47:45 +0100 Message-Id: <1484218065-28637-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 Cc: Oder Chiou , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Mark Brown , Nicholas Mc Guire Subject: [alsa-devel] [PATCH] ASoC: rt5660: use msleep() for long delay 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 ulseep_range() uses hrtimers and provides no advantage over msleep() for larger delays. For this large delay msleep() is preferable. Link: http://lkml.org/lkml/2017/1/11/377 Fixes: commit 2b26dd4c1fc5 ("ASoC: rt5660: add rt5660 codec driver") Signed-off-by: Nicholas Mc Guire --- Problem was found by cocinelle script. Patch was compile tested with: x86_64_defconfig + CONFIG_COMPILE_TEST=y SND_SOC=m + SND_SOC_ALL_CODECS=m (implies SND_SOC_RT5660=m) (2 sparse warnings - fix in a seperate patch) Patch is aginast 4.10-rc3 (localversion-next is next-20170112) sound/soc/codecs/rt5660.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/rt5660.c b/sound/soc/codecs/rt5660.c index 76cf76a..78a77bc 100644 --- a/sound/soc/codecs/rt5660.c +++ b/sound/soc/codecs/rt5660.c @@ -1152,7 +1152,7 @@ static int rt5660_resume(struct snd_soc_codec *codec) struct rt5660_priv *rt5660 = snd_soc_codec_get_drvdata(codec); if (rt5660->pdata.poweroff_codec_in_suspend) - usleep_range(350000, 400000); + msleep(350); regcache_cache_only(rt5660->regmap, false); regcache_sync(rt5660->regmap);