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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13202C433F5 for ; Thu, 6 Jan 2022 14:58:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240264AbiAFO6X (ORCPT ); Thu, 6 Jan 2022 09:58:23 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:41016 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240242AbiAFO6W (ORCPT ); Thu, 6 Jan 2022 09:58:22 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 156E71F37F; Thu, 6 Jan 2022 14:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1641481101; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AlLgF12W+lx81xwUCYXyGGONIpHAWudNazUhJluGHEE=; b=XGYkk0sqKOcFIPYaLMzKqeo0f5d7Zq/hvKrrjye2mOv+RHVxZ1W8Xa0F5JDGAGtqD8kj+i WoteIhX/SUAv4GKZacQNGkLE7iB8H7sHeO940NFz436x07doQBSAFjPCgNkkr6we+fCoZb 5Ys4l3gaFeJAoMVM4pDKeECyxf2K2yo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1641481101; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AlLgF12W+lx81xwUCYXyGGONIpHAWudNazUhJluGHEE=; b=XHXNnEfyvuW2HpOCSsI0aZjPICyt+GI/4/DQPKHVPL8d5ObTdPkD7hKn2y8Pth2J5Luxxm r4RDmRxz9rZUgqBg== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id DDD75A3BDD; Thu, 6 Jan 2022 14:58:20 +0000 (UTC) Date: Thu, 06 Jan 2022 15:58:20 +0100 Message-ID: From: Takashi Iwai To: Jiasheng Jiang Cc: perex@perex.cz, tiwai@suse.com, leon@kernel.org, broonie@kernel.org, joe@perches.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ALSA: intel_hdmi: Check for error num after setting mask In-Reply-To: <20220106094402.2738082-1-jiasheng@iscas.ac.cn> References: <20220106094402.2738082-1-jiasheng@iscas.ac.cn> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 06 Jan 2022 10:44:02 +0100, Jiasheng Jiang wrote: > > To maintain the consistency of the code, it should be better to add the > sanity check after calling dma_set_mask_and_coherent(), like > tegra_pcm_dma_allocate() in `sound/soc/tegra/tegra_pcm.c`. > > Signed-off-by: Jiasheng Jiang > --- > Changelog > > v1 -> v2 > > * Change 1. Remove the fixes tag and change the message. > --- > sound/x86/intel_hdmi_audio.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c > index 33b12aa67cf5..6caea517f07f 100644 > --- a/sound/x86/intel_hdmi_audio.c > +++ b/sound/x86/intel_hdmi_audio.c > @@ -1770,7 +1770,9 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev) > card_ctx->irq = irq; > > /* only 32bit addressable */ > - dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); > + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); > + if (ret) > + goto err; The build fails with the latest code, unfortunately. This function simply returns an error, as it was changed to a devres allocation some time ago. thanks, Takashi