From patchwork Thu Feb 25 18:06:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 387361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06DE8C433E6 for ; Thu, 25 Feb 2021 18:09:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C043B64F39 for ; Thu, 25 Feb 2021 18:09:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233311AbhBYSIl (ORCPT ); Thu, 25 Feb 2021 13:08:41 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:18977 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232557AbhBYSHb (ORCPT ); Thu, 25 Feb 2021 13:07:31 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 25 Feb 2021 10:06:39 -0800 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 25 Feb 2021 18:06:38 +0000 Received: from audio.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 25 Feb 2021 18:06:36 +0000 From: Sameer Pujar To: , CC: , , , , , Sameer Pujar Subject: [RFC PATCH 1/5] ASoC: soc-component: Fix return value of snd_soc_component_set_pll() Date: Thu, 25 Feb 2021 23:36:00 +0530 Message-ID: <1614276364-13655-2-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1614276364-13655-1-git-send-email-spujar@nvidia.com> References: <1614276364-13655-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1614276399; bh=MRsEzDmf7J4bxm3LNb2m3+5Sy3ePQpn1ormjOx9bR/Y=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=rjwIH2EkYa0ZBOPnaNJu7vhjIgmBT2tQ8vnw6WoTJB9a5ab17z4EgJSmbwECxUM4O FpxT9CjPwJQRe001VBcNuN4szeZscfAf92f5sekbJYkU2AaWe02c8AErvX7C9DVKQd FxS35NvFyuprX6GiJ7HcsTvXVut34PGx4PDRxfgua7ZXxMOnVMjQCLjchyDYtHJabB SB4ApQEEvW5UxhECAlmf94Nfah26k5+sVHSYll3BejpAbSV9triIpPCB3ZOSYwtVJe 7FPubV607Hul0rT4/1tO6uYwZnd9QlAv6LhqnSTy6eoQqcb1HV+8Qxoyy26WbXZRrm mUmC4Lr+xT0Pw== Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org snd_soc_component_set_pll() returns "-EINVAL" and prints following error if a component does not implement set_pll() callback exposed by the component driver. This happens when snd_soc_dai_set_sysclk() is invoked, which in turn calls snd_soc_component_set_pll(). "ASoC: error at snd_soc_dai_set_pll on xxx: -22" Above is not necessary because a component may not need additional configuration and chooses to not implement this. Fix this by changing default return value to "-ENOTSUPP" and driver code which invokes snd_soc_component_set_pll() can ignore this error. Signed-off-by: Sameer Pujar --- sound/soc/soc-component.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index 159bf88..fd04e75 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -109,7 +109,7 @@ int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id, int source, unsigned int freq_in, unsigned int freq_out) { - int ret = -EINVAL; + int ret = -ENOTSUPP; if (component->driver->set_pll) ret = component->driver->set_pll(component, pll_id, source,