From nobody Fri Apr 10 21:56:00 2026 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 5B013C32772 for ; Thu, 18 Aug 2022 16:54:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345120AbiHRQyG (ORCPT ); Thu, 18 Aug 2022 12:54:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345117AbiHRQyC (ORCPT ); Thu, 18 Aug 2022 12:54:02 -0400 Received: from hutie.ust.cz (unknown [IPv6:2a03:3b40:fe:f0::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C5D682768 for ; Thu, 18 Aug 2022 09:53:57 -0700 (PDT) From: =?UTF-8?q?Martin=20Povi=C5=A1er?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1660841633; bh=UNExzyKi9/UuVlXmQ0/fkVUBcJ7BQOxDg9rg7qwczx8=; h=From:To:Cc:Subject:Date; b=pQ1pBQ1RoVCQQBsbxtiv2jZAzlNx/1fuy5Xzfi3uG/ZsePDUPS2bYmKHul2wvpBmr Y1mRlXgQglfBYg7DlbBCFzMhQfEasklu0JmM9yVDyBg0y1qdrSOw1WYQvwea7xMcqC J0bT/6eTC4EsMmNaTFDt4rQdX7EUMTRfBbfbfNVY= To: Liam Girdwood , Mark Brown Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Martin=20Povi=C5=A1er?= Subject: [PATCH] ASoC: Change handling of unimplemented set_bclk_ratio Date: Thu, 18 Aug 2022 18:53:36 +0200 Message-Id: <20220818165336.76403-1-povik+lin@cutebit.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If a 'set_bclk_ratio' call is attempted on a DAI not implementing the method, make it an -ENOSUPP error instead of -EINVAL. Assume the DAI can still be okay with the ratio, just does not care to register a handler. No current in-tree users of snd_soc_dai_set_bclk_ratio seem to inspect the return value, but -ENOSUPP disables an error print from within the common soc_dai_ret return filter. With the new behavior a machine driver can do a blanket 'set_bclk_ratio' on all DAIs on a bus, some of which may care about the ratio, some of which may not. Signed-off-by: Martin Povi=C5=A1er --- sound/soc/soc-dai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index d530e8c2b77b..49752af0e205 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -124,7 +124,7 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_pll); */ int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) { - int ret =3D -EINVAL; + int ret =3D -ENOTSUPP; =20 if (dai->driver->ops && dai->driver->ops->set_bclk_ratio) --=20 2.33.0