From patchwork Wed Jul 26 00:35:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 9864061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E4BEC6038F for ; Wed, 26 Jul 2017 00:35:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D409D286FE for ; Wed, 26 Jul 2017 00:35:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8E4928726; Wed, 26 Jul 2017 00:35:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3046B286FE for ; Wed, 26 Jul 2017 00:35:53 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 09C5926738C; Wed, 26 Jul 2017 02:35:31 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 504CE267377; Wed, 26 Jul 2017 02:35:28 +0200 (CEST) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) by alsa0.perex.cz (Postfix) with ESMTP id 8490E267374 for ; Wed, 26 Jul 2017 02:35:26 +0200 (CEST) Received: by mail-it0-f52.google.com with SMTP id h199so59603998ith.0 for ; Tue, 25 Jul 2017 17:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TR9zC317Kp7gqGfgz4u66mf0tfjnT4mjZLI3ecSmdzw=; b=HdBox3oQT6jtW9qBuWA3KzLnjgwsZasJolu54Gzmnw+p3n6QrwEvgdo/yRf0B0555D ATYrtpNai38vAZMYNuXV5GFL5bfNPGyA7KuM7roBMrCC1vzR6mfzYfUbYxax1nvTyYJ+ oWrqGwSC3Uohw75CIMNXyAAYShrVhnAD+HShE= 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:in-reply-to :references; bh=TR9zC317Kp7gqGfgz4u66mf0tfjnT4mjZLI3ecSmdzw=; b=ZomnSzgmLTrmlukVFMEd+3Jppyfkp2WfWLTYAV8eXYUR6QV1NT3UOYFw5yxIQRXDy0 Umhy/1fRZp9WKYdfMvKqUoEHRFlFdfQYcxiw9BbjmF3Eg/SoOAvMzxHQuczBhAbf2IqQ DbqV44YSfMbS3+Y12c0CMh6OJcO3xTnAAzENeJtrxY7coEDvQuiTVqLxThZiPC1kIStH 2wPJ/i5zLLgTDrkZvCQ+e/v9CpClzsal2r+f6RDBF+YzRCHy0NaeNSMdIu5LBLSa/iRA C9t9c5aHOosCJ1sXq5DmG6jPcEbQ3NLoz+shkvl/CXTWh8Zvl2IzGlXZUtMTaCAXH3uv fZ5w== X-Gm-Message-State: AIVw110tVIPWb7J92wzzbz+ICABsS7J+1811tMOfUzdDf4Uhc9byx0Mi wa6zENh9/JUaWdfZ X-Received: by 10.36.94.129 with SMTP id h123mr8053373itb.110.1501029325628; Tue, 25 Jul 2017 17:35:25 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id l69sm5097373ioi.49.2017.07.25.17.35.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Jul 2017 17:35:25 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Mark Brown , Banajit Goswami , alsa-devel@alsa-project.org Date: Wed, 26 Jul 2017 02:35:07 +0200 Message-Id: <20170726003512.18965-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170726003512.18965-1-srinivas.kandagatla@linaro.org> References: <20170726003512.18965-1-srinivas.kandagatla@linaro.org> Cc: linux-kernel@vger.kernel.org, Patrick Lai , Srinivas Kandagatla , Takashi Iwai Subject: [alsa-devel] [PATCH v1 1/6] ASoC: jack: fix snd_soc_codec_set_jack return error X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Srinivas Kandagatla This patch changes the error code returned by snd_soc_codec_set_jack() from -EINVAL to -ENOTSUPP. The reason to do this is to make the caller aware that the underlying codec does not support this callback. This can make the caller write the code to handle this case properly. Other reason is that -EINVAL is not the correct error to return in this case anyway. Signed-off-by: Srinivas Kandagatla --- sound/soc/soc-jack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index 7daf21f..42ca9f1 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -36,7 +36,7 @@ int snd_soc_codec_set_jack(struct snd_soc_codec *codec, if (codec->driver->set_jack) return codec->driver->set_jack(codec, jack, data); else - return -EINVAL; + return -ENOTSUPP; } EXPORT_SYMBOL_GPL(snd_soc_codec_set_jack);