From patchwork Wed Jun 7 09:41:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13270314 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7B0BEC7EE23 for ; Wed, 7 Jun 2023 09:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=iNkVgnv8IdFKEq4bpDZ9jnNIawV5Mt/RgIgaV0lhCBI=; b=kVaYCp5SpTQVnj D1H3Wlg2p38UPZEICoCBTFomgzh88XDACJsjSE5IVUOMVGi+jDNFN7WPN08mvxdKXS352tAjKU44h HlDq034shqCZno6V6YpcLIKG+zcMl/fIC6V/NdbJo5jTu4evoBEVLHhUDl0UhlBwQRK6nppvDXNdw MOduTPY1Z+wEICoiKu8FxgvHuVI1sL59u7i5cOiozNPAIw/iBaNNMyT0bfXKpyli+wANmOyAUeSnN LAsLlO+V3PbrifH8FNCqO2frW/znDiVPAOrOLPyqnCOzs6LJp9Q05vMaIaW19PNWE/uXRbAKqfHVp BqeckTCvsMvNmtVU20cA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6pg6-005IVQ-0j; Wed, 07 Jun 2023 09:42:06 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6pg4-005IT3-0C for linux-arm-kernel@lists.infradead.org; Wed, 07 Jun 2023 09:42:05 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f7378a75c0so29581025e9.3 for ; Wed, 07 Jun 2023 02:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686130919; x=1688722919; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=G6Lo+18sIXzxNcuFSTXduKxmc08cyUDjNGZNtZkUahY=; b=AwLzbIm1zg0K9edsLuu1NPocZIg/6ycVQovwysMtzw1bJxOUTxjkJrih+FSr6FZL0S oVilKsEKAD/Y6IbWIJZBBNFhrz6P5rEMXlaQ3OPDg/Yqlvbz5ZBuANiBDrcpSre/F1Fw pXbSiPDfbmN/8xL919riWuZgDoVDRT2BKp0tZDKEJjH0O/YjAkZzTJtyICE94xEOb741 aL/VIR6a++MpCXo/Rblos5rTbmlJlhRiMrKqJXjfecy6eEofY3JAkDU2LCsSQvGyAUEL zHEPAkEfJxgZ8HzN1ObF4l1/T5/CgOi7ZLqZsrhg0idw3yyZj2eudGlAKt6DhSv7aWKC aAHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686130919; x=1688722919; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G6Lo+18sIXzxNcuFSTXduKxmc08cyUDjNGZNtZkUahY=; b=C2G8OObyDNQXQxT4eqz5ZguzFkDfQYQW8S1YeO+VBzoM04uJ/QRb44qjjMgm+PlDve MDedLZIlBGrMO79njZ0qjvS8kg706hjmGw7SCTMyRZCOHuCWMg6gZOe5vtDsJgQgjf7t xB0R5G/hh0M698xagaXWTIFBNbax4dQ9+oJyMXZJXleNjnlJpvrrCSXwvgDeX7BE1x1d NHtI8A5l/ofxBfGFh2g4/Aql1VmcwecdvOtrNnfk1upz/8Hvq1QDNHTbgDsefjnD1L8L KTcALex9moY7hJEU3kSA3iGMjhrtebfIH2SXowoqRYrfoVFye/lkuhr8aFtzGQSTc2Zv g8yg== X-Gm-Message-State: AC+VfDyRIMdxnvzLV6zoou0U92FCwAFxpHaCHqQkOa+qTYMV0v1bULPZ 0MobP3Vn+o2dKU/mP/fPHlLGAw== X-Google-Smtp-Source: ACHHUZ6Xh/LwcZ+rZVHzsTOg4l/H6d1/H3rWqOqZY6ABx67wn1KYIBuLFgv2YJrWxIXpyw52rn7ENg== X-Received: by 2002:a05:600c:287:b0:3f4:2452:966a with SMTP id 7-20020a05600c028700b003f42452966amr4432811wmk.27.1686130918955; Wed, 07 Jun 2023 02:41:58 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id y8-20020a7bcd88000000b003f4ecf1fcbcsm1541154wmj.22.2023.06.07.02.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 02:41:56 -0700 (PDT) Date: Wed, 7 Jun 2023 12:41:52 +0300 From: Dan Carpenter To: Trevor Wu Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , AngeloGioacchino Del Regno , Alexandre Mergnat , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel-janitors@vger.kernel.org Subject: [PATCH] ASoC: mediatek: mt8188-mt6359: Fix error code in codec_init Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230607_024204_099438_CF291729 X-CRM114-Status: GOOD ( 13.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Return -EINVAL on this error path instead of returning success. Fixes: 9f08dcbddeb3 ("ASoC: mediatek: mt8188-mt6359: support new board with nau88255") Signed-off-by: Dan Carpenter --- This is based on static analysis and not tested. sound/soc/mediatek/mt8188/mt8188-mt6359.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c index bc4b74970a46..ae02bbcd5d4e 100644 --- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c +++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c @@ -594,7 +594,7 @@ static int mt8188_max98390_codec_init(struct snd_soc_pcm_runtime *rtd) } if (rtd->dai_link->num_codecs <= 2) - return ret; + return -EINVAL; /* add widgets/controls/dapm for rear speakers */ ret = snd_soc_dapm_new_controls(&card->dapm, mt8188_rear_spk_widgets,