Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp325195pxb; Fri, 16 Apr 2021 06:41:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcIwpVvz2WBIe0m15a3PWsBVIj72qRR6y1tlQRNVKBclpVO16HNso/A30LC316yXjs3mZy X-Received: by 2002:a05:6402:1b1c:: with SMTP id by28mr10041653edb.62.1618580465144; Fri, 16 Apr 2021 06:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618580465; cv=none; d=google.com; s=arc-20160816; b=l6fiJ92Hgczx8KMfOL5JbwUbTBVrhsXyo8BaO+lCKsBnuAyi9kmkAMKCyOgM9/PMrH Xx4f3dVLQXm0ZyUPUp0lFgmSIu/BoZjV0bDoTdulfefUcSbfya6Un5eD1z4j2sXCm3mb DZmLLHlUs+5plpWVp8wJOoHjv/oVEeaoiIAXsmMKRuMhUlzfSJWnAH9WMwEl4EHPzBnS sdGzT1opLVv80nELsLJXh+ZCOq98VR2X7AD67xvK54pK0uQjRNdoy7K+VpHEjzgPLPKK HJenMIm59au7Xlaj6oLYdVU0A24dLqNS6m3krj4CWN8Y3OqyxxM+PVK2Nt5j6PzKwhch vBLg== 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=13KEuXHINYB61UDE8lCEHmZW9j2W+9ih7JIgjD89C1g=; b=On+sfb5lRRi+/LRyNVPSSmnDXPXbvYXaqELdAiciH2AKcqmGmW6VeAS82XLJETOVG5 NNDpQS4D9OC6CEWd3fX8Gs4Jp+9XWegfvOq74yYdOqFnSNMnK4VKYtRKJDRoRlf92oa/ ERtU7beqKibbejhATkOx9qF3gfRZD4EBEqJLgZUL0JEmItEWJSgu+f67Au1u1sS8m2Xm cKDHhmHC2PAOJ4xB/WmuEva2GMa0w/9H3QzwJiwcC5rKwuOj019sFOogw1g5XPTZUq3d H9K00WRl2cZWN1y8S61h9Xi6BjMMRxBrgxftuhkbstPiMq3JjhR/0H13UzrGUscMne1l ZoWg== 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 m9si4662959eje.591.2021.04.16.06.40.41; Fri, 16 Apr 2021 06:41:05 -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 S240026AbhDPMAX (ORCPT + 99 others); Fri, 16 Apr 2021 08:00:23 -0400 Received: from inva021.nxp.com ([92.121.34.21]:55746 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbhDPMAW (ORCPT ); Fri, 16 Apr 2021 08:00:22 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5065C203A52; Fri, 16 Apr 2021 13:59:57 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A630F203A48; Fri, 16 Apr 2021 13:59:54 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 689D54032B; Fri, 16 Apr 2021 13:59:51 +0200 (CEST) From: Shengjiu Wang To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: ak4458: check reset control status Date: Fri, 16 Apr 2021 19:45:02 +0800 Message-Id: <1618573502-1488-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 check the return value of ak4458_rstn_control. Signed-off-by: Viorel Suman Signed-off-by: Shengjiu Wang --- sound/soc/codecs/ak4458.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/ak4458.c b/sound/soc/codecs/ak4458.c index 85a1d00894a9..0a94973889a1 100644 --- a/sound/soc/codecs/ak4458.c +++ b/sound/soc/codecs/ak4458.c @@ -419,8 +419,13 @@ static int ak4458_hw_params(struct snd_pcm_substream *substream, snd_soc_component_update_bits(component, AK4458_00_CONTROL1, AK4458_DIF_MASK, format); - ak4458_rstn_control(component, 0); - ak4458_rstn_control(component, 1); + ret = ak4458_rstn_control(component, 0); + if (ret) + return ret; + + ret = ak4458_rstn_control(component, 1); + if (ret) + return ret; return 0; } @@ -429,6 +434,7 @@ static int ak4458_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) { struct snd_soc_component *component = dai->component; struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); + int ret; switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBS_CFS: /* Slave Mode */ @@ -461,8 +467,13 @@ static int ak4458_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) ak4458->fmt == SND_SOC_DAIFMT_PDM ? AK4458_DP_MASK : 0); - ak4458_rstn_control(component, 0); - ak4458_rstn_control(component, 1); + ret = ak4458_rstn_control(component, 0); + if (ret) + return ret; + + ret = ak4458_rstn_control(component, 1); + if (ret) + return ret; return 0; } -- 2.27.0