Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2376526pxb; Mon, 19 Apr 2021 04:26:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwz4OwSEOQrjdlYGbAdN0XpaCSyBKd+aRfxslIXjx40RcLtrmrF/g9GsRDPCuhYuzuaP2+p X-Received: by 2002:a17:907:6192:: with SMTP id mt18mr22015302ejc.530.1618831570484; Mon, 19 Apr 2021 04:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618831570; cv=none; d=google.com; s=arc-20160816; b=LD/KM9J7Q4j5h4iuperey1IKpJvriho7DZWyXIf7jtsUhs+rhfve5ASUeQH6yefKas W+b4FcSdC1wjF4+M+7d0myT8CKAPlDlWG9em7TMBbWepvRvktNtOtpQVQueFT2C+RJUM 2WaSjBPZIhx/lt0ydA0j2SkaT50eSD6sOE/pDuXejWQg+qEh+YLbt3hL3bn31rU/mxfc u49r8mPhyCqvLFVB9Pm3p0aHlnVEG7mzCE6JAkuE27aXS8iEajGSBLx7dCKhVGFQsWrv lRMfw/jNTSkJHm0+Rsqwx8pvqFy5xEsf4LbRsxny4peB1/pzJh2EsbslQytnT0BZyTvP Emmw== 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=/dgu9ipXL6eEBifUg7Ryr6F0FPH8FeFMMQAJ8dTKwwY=; b=TczEh5pza/5NcoWxYKel7U8XeP8v/uxf4FfUoMHc7IKlN0qPGJ1XhaJsxPf/akeAWk HWdcXC6QuWRbSJsMbFICakZGBsw82OGyc30jumaY6LtpC5y36VGO+VWOEWlINE+gZTOI HvF3JTqxAmV+Zoqix6WG7yqC9dS0+Xb/6ezDEU/z91Z5w+qjRNNQP5+3EPguxvgCppHK k/lAiBFRiQ17LaEzRo7Y+qQhauJl+8c+Yloski/l5Eylliq7fBeSXKzkM7VJ11B5TKYY yOerUr7CNC9L6X9w3hiDuMpupDLiyIL3ZT2XO4Gq+dJp1OAN/aqz1JecjF/L8JP4fMjO 9Hbg== 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 du8si6752551ejc.547.2021.04.19.04.25.47; Mon, 19 Apr 2021 04:26:10 -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 S232929AbhDSKKg (ORCPT + 99 others); Mon, 19 Apr 2021 06:10:36 -0400 Received: from inva020.nxp.com ([92.121.34.13]:52616 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231307AbhDSKKf (ORCPT ); Mon, 19 Apr 2021 06:10:35 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5CD981A26EC; Mon, 19 Apr 2021 12:10:05 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 9DDB91A26E7; Mon, 19 Apr 2021 12:10:02 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 8657A4031F; Mon, 19 Apr 2021 12:09:36 +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 v2] ASoC: ak4458: check reset control status Date: Mon, 19 Apr 2021 17:54:32 +0800 Message-Id: <1618826072-29344-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 --- changes in v2: - fix "use of undeclared identifier 'ret'" reported by kernel test robot sound/soc/codecs/ak4458.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/ak4458.c b/sound/soc/codecs/ak4458.c index 85a1d00894a9..3088128816bb 100644 --- a/sound/soc/codecs/ak4458.c +++ b/sound/soc/codecs/ak4458.c @@ -334,7 +334,7 @@ static int ak4458_hw_params(struct snd_pcm_substream *substream, struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); int pcm_width = max(params_physical_width(params), ak4458->slot_width); u8 format, dsdsel0, dsdsel1; - int nfs1, dsd_bclk; + int nfs1, dsd_bclk, ret; nfs1 = params_rate(params); ak4458->fs = nfs1; @@ -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