From patchwork Thu Jun 16 22:04:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 582242 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 9738CC43334 for ; Thu, 16 Jun 2022 22:07:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CF50C1B2C; Fri, 17 Jun 2022 00:06:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CF50C1B2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417246; bh=/a6xHCENUfZj9j10Aqoo/Athc0o1eiMxR95TofNjmTI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bkLEx6NFZpZylVpTAK3srllef5KlnCfXPRncZKVdh/XhX5uoeCccvreaXE88efsEP 6VRUVLCRFcjTxIWab0JZjUAyVsG0+4mUDNQJVdWzR7O0v/Y45R3jWDNihNJuKicGbx pNgq5HqpUqLG0iVljNfio81jcEpzCWiXju7tN3EE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 779A2F8054A; Fri, 17 Jun 2022 00:04:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D8BC5F8053C; Fri, 17 Jun 2022 00:04:53 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 D89F3F80534 for ; Fri, 17 Jun 2022 00:04:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D89F3F80534 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="T45zlEav" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417091; x=1686953091; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/a6xHCENUfZj9j10Aqoo/Athc0o1eiMxR95TofNjmTI=; b=T45zlEavj3VnsgJXRqZSKe7R28JKsM/HPwEqsifx0ngQnctS3Q7cZNAL 5G7N3tOVNgdgnWtetSKyVMWKEzqk6GZEBx4UuGAUO0h64N9u6CQgzC8Xy sxzDrOoC8J1xx42vZk+r/5E7Zy+uU+MnS5gENzZHr/YJLZtxtiSeC1gUH qzZMMzo69RLNPkf3DzjEv+pm/svXTTcSKYAsaAN4V/Ps8LoQqCQu3aP20 jgBy7CAgfJFWPD19VspOGrMPTzI4mIZIxIhAWknhCNMhh9ETzJt7BlUf8 /kiVwoyXoV/5nEZPIn7C2p8d+/SMwi42ikINi1lh2cthU+EZsEywGor9/ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810959" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810959" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:49 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728085020" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:48 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 08/11] ASoC: img: img-i2s-out: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:24 -0500 Message-Id: <20220616220427.136036-9-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Charles Keepax , Kuninori Morimoto , Kai Vehmanen , Liam Girdwood , tiwai@suse.de, open list , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Simplify the flow. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan --- sound/soc/img/img-i2s-out.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/img/img-i2s-out.c b/sound/soc/img/img-i2s-out.c index 9ec6fc528e2b4..50a522aca419a 100644 --- a/sound/soc/img/img-i2s-out.c +++ b/sound/soc/img/img-i2s-out.c @@ -346,11 +346,9 @@ static int img_i2s_out_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) chan_control_mask = IMG_I2S_OUT_CHAN_CTL_CLKT_MASK; - ret = pm_runtime_get_sync(i2s->dev); - if (ret < 0) { - pm_runtime_put_noidle(i2s->dev); + ret = pm_runtime_resume_and_get(i2s->dev); + if (ret < 0) return ret; - } img_i2s_out_disable(i2s); @@ -482,11 +480,9 @@ static int img_i2s_out_probe(struct platform_device *pdev) if (ret) goto err_pm_disable; } - ret = pm_runtime_get_sync(&pdev->dev); - if (ret < 0) { - pm_runtime_put_noidle(&pdev->dev); + ret = pm_runtime_resume_and_get(&pdev->dev); + if (ret < 0) goto err_suspend; - } reg = IMG_I2S_OUT_CTL_FRM_SIZE_MASK; img_i2s_out_writel(i2s, reg, IMG_I2S_OUT_CTL);