Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1375628ybh; Thu, 23 Jul 2020 07:24:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTF4peGWMOzLSKU6R+HFkjBsMbltNfGAcInvKvUgwIbjDbq1Ny64PmmS8l7Gjrz4/W0zq4 X-Received: by 2002:a17:906:fac1:: with SMTP id lu1mr4829308ejb.427.1595514248675; Thu, 23 Jul 2020 07:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595514248; cv=none; d=google.com; s=arc-20160816; b=qppuLUIRs1UL3AlLCYGCT8+SAlpllelm2lX8BXWpPUcFNDFB6JcNCzuiY3+In9+xLm Wja57CbNg2yPLnKJdgTvRHztEUt7k+F1E7jbsYBBtD6aPJ8aIuiiwx7tSn5Hbk430ktJ nUlvrXOIMNSJgNK3rMpK8vwhcqm4bfr6jX2qhDaWKlSTy80NdSoaJRZXpYuUGepEdkiP K/yjWi3RpQ8cag8xXvUiC87ghDrhal0npVYFaFYGFoDz0pEf/JV5aPmf4We+UFQfBv9n //eIDSkimVzy76kT0wKye49Qsqrcj4lJ8orIFZ3r+ZUj0KXFhZ7UPykgr9euq0lhyrLp Z55A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ntQu/VIUE9Ak1XWr+tVal7WWTvSlvV5WCmELVlSDg/A=; b=PQodgigpX7engIdLyCULfu30FLoi7a21/E++iJQfKXqmjV8q+qB9MXyS9AU8aYI2Kf a/u2EingqFQudXWzN8kmSESPBjBaOPJwApS7uxqYCpVJa3JJHIL4ehAv3ZB9mktrl3Gv iQkYtJJuInOohA2tF3mxFo1C0xJTAgCK4eUr6coYOdbJEuTjnj/bQPjvQ28FfPDdtP8y JdyyOVKy0Rtxstm1F6970h5D5IMhSJQoq8MEcw1yu5aHCpIxBD83WECIfn7qwxKfvW8i lJaZ5u0hEjaRTDoY1us6kpsaC0Q1x8VLotUSjCXWEL9V9XTfS/Ir+MaU4KFWRHM7NoqP Q9Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=wkpo7qVf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si2121169ejy.691.2020.07.23.07.23.46; Thu, 23 Jul 2020 07:24:08 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=wkpo7qVf; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729029AbgGWOUk (ORCPT + 99 others); Thu, 23 Jul 2020 10:20:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727111AbgGWOUk (ORCPT ); Thu, 23 Jul 2020 10:20:40 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CB21C0619DC for ; Thu, 23 Jul 2020 07:20:38 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id y3so5350200wrl.4 for ; Thu, 23 Jul 2020 07:20:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ntQu/VIUE9Ak1XWr+tVal7WWTvSlvV5WCmELVlSDg/A=; b=wkpo7qVfmRQMPMxDfZe4UMyUKZbbfKfNEbl/ATyQ+ZamsFKEYkAJMnnsF70gm8MOJT tIeMGGPN/oAeSvdffe4TFe9/EYgHs94i2eaGJHJCQYh0XOo512GHFUdIlei/g7RliGDx D5O96c3ZwG2Bzr3+W5nwShYdzfOK89O4fKPNtmdk87x3U7ngJrYSSjHvTbZyfjO7Zf6H Zxisg/HN2v9MGvbqicfa8OINsM2xCR3Vb98qLOSCA0bmAQIvu0YRJw2e8NO/+af+e4iw fyjNMe4l21vet1zGIgwezkr5OkgUswi3wP/pJLcRDxHYQZkWCXdnNLYbhwozC9Ore0Tl GAnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ntQu/VIUE9Ak1XWr+tVal7WWTvSlvV5WCmELVlSDg/A=; b=HMXRv5dzFD9Pw+QGKM+WJRZ4i2Tbc+xDSgBk0yI88gwnM3gMy8zbrrKgpTxqtFzw5y rvmqIyeWSheifCf3AF1aCI9pbbnaikPqkHdG4N7pHA/3y5Uo28ghGAHVP3AQLDCbicfb Iaa8HKlQeRvqRQxloiXDSdYtU6aaPQ8JuhQUKgnopmt/Qo7qwh8JSTud+8TSEBzL3PED cKNe6wJnCdZ6PNmfsD+CPtrid0qlyaB33miEcNxrhE1ryGJh2MUxZDiRtkiTt7QYIs3V xXl4J7offQIV8ZBhopMpDhT1dQ2n4dxbcKsT3pOgop0woYqnw22+Z6B8sVvW4VgAdylC D+Gw== X-Gm-Message-State: AOAM533rO+nz7J0vatPbDC7XN7jpVtAF2sChyS/bvXhfi2Y4mLQ7Uetx 8sQ/XbYEgQGkELEe1Yrd/v3WTg== X-Received: by 2002:a5d:4751:: with SMTP id o17mr4352832wrs.345.1595514036969; Thu, 23 Jul 2020 07:20:36 -0700 (PDT) Received: from starbuck.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id w2sm235204wre.5.2020.07.23.07.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 07:20:36 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH] ASoC: soc-component: don't report of_xlate_dai_name failures Date: Thu, 23 Jul 2020 16:20:20 +0200 Message-Id: <20200723142020.1338740-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With commit e2329eeba45f ("ASoC: soc-component: add soc_component_err()") every error different for ENOTSUPP or EPROBE_DEFER will log an error. However, as explained in snd_soc_get_dai_name(), this callback may error to indicate that the DAI is not matched by the component tested. If the device provides other components, those may still match. Logging an error in this case is misleading. Don't use soc_component_ret() in snd_soc_component_of_xlate_dai_name() to avoid spamming the log. Fixes: e2329eeba45f ("ASoC: soc-component: add soc_component_err()") Cc: Kuninori Morimoto Signed-off-by: Jerome Brunet --- If we wish to report an error when no name is found for dai phandle, I think it would be more approriate to it with with "struct device *" of the card, which is the one actually failing to get what it needs. These user of snd_soc_get_dai_name() are already reporting the error: * sound/soc/samsung/tm2_wm5110.c * sound/soc/rockchip/rk3288_hdmi_analog.c These could be silently failing: * Simple cards * Amlogic's cards * Samsumg odroid card sound/soc/soc-component.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index 9565a0dd7cb6..fb6479b22d26 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -344,13 +344,15 @@ int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component, struct of_phandle_args *args, const char **dai_name) { - int ret = -ENOTSUPP; - if (component->driver->of_xlate_dai_name) - ret = component->driver->of_xlate_dai_name(component, - args, dai_name); - - return soc_component_ret(component, ret); + return component->driver->of_xlate_dai_name(component, + args, dai_name); + /* + * Don't use soc_component_ret here because we may not want to report + * the error just yet. If a device has more than one component, the + * first may not match and we don't want spam the log with this. + */ + return -ENOTSUPP; } void snd_soc_component_setup_regmap(struct snd_soc_component *component) -- 2.25.4