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: 108721 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp198442qge; Tue, 25 Jul 2017 17:35:31 -0700 (PDT) X-Received: by 10.84.140.3 with SMTP id 3mr23811138pls.374.1501029331542; Tue, 25 Jul 2017 17:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501029331; cv=none; d=google.com; s=arc-20160816; b=CQFS8AEoyX6Ltzt2aFCnqEUIuJ7vPkw4muPY7mHHfwiKNVZ0vztLFDtN/W0mfvq6Ml fQvckFy/hU+bojNUpNYHcpwPi7aIgi5l31pAxvXFh9+J4DZr9TyNEveaIYTMRDVmINEm d74V1FC5mWJLDY/IVes/uE5sV3WlhgqGuDhPKvnYqhGQ5lk5L3AEC4131ISur50s/e71 sEhTfvSAXc0gfSXZfs9nexF7s10hs1QiXrvP2YxGXXMY6HN46lHHq7YFJm5ZhXYhyWrA jmryTux4foAktyD1+i7l4PSAARVd1zAzBBfZKrFZkf3odx+YZZjewwxELKGXxBjLqaIZ LsRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=TR9zC317Kp7gqGfgz4u66mf0tfjnT4mjZLI3ecSmdzw=; b=t2Tl0pTr5XHxS4VsjOt5gKI0cVbKsia0lzHkba/i4sqv6an1V89kxQa9CDBuYV3QAM w9RZo6tvCVkfQJr5EKzVHu+PBWHqbBAomTlOIhFKp6h+scMt3E/k6xcxVLEgWjqjqfBE 2o6SqyIWbfz3M54KCQQh611tItkumaMKoIbuW3NQLWdFt1SCzu/XMWaCvUEObV3pS/jt gf5ydTGmjRrDRB/W2LMXJQwuN5Bf2RxSfTt73vVZQvEj+nLzsmDsBOMZAQsJNRu8cDtp +hrYncuKdukhenGCCKG0qM9/B6G69gvNGTFW1KRYUeBuUIwj2d2yuqIGv2EASXQSUojM 4dFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=HdBox3oQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11si8931433pgc.125.2017.07.25.17.35.31; Tue, 25 Jul 2017 17:35:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=HdBox3oQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751817AbdGZAf2 (ORCPT + 26 others); Tue, 25 Jul 2017 20:35:28 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:35959 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625AbdGZAf0 (ORCPT ); Tue, 25 Jul 2017 20:35:26 -0400 Received: by mail-it0-f46.google.com with SMTP id v205so42837968itf.1 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=c+KU2f3mXYzcTYKoxGkrHRcCKJmkfDVTRtRcQTs1jTvvgkl3K0hsEfTMgDn7zKXjjf T6TR8JF6BHTiIbIrhE0KBjmIpMb46OzzT97KGIrewwg1KLHk0UV2ddB9ySXNIyWUIV5b +I2ZclKDoq0IiNne/nWE4QQGr0lbvI/UoOwFraQ6oCJazgDSjyrZ7M7EqI2QI3LZl0aE 98H9IzzhgO+Yc6oYIyD/w49aijoIYiacRGguehnFOoUTnng6KIgsPE4hrPRl4Z3Ol539 GTOZsCTGcuJnC3InVGqYXTms0Tu82e2H6vs/++gPPvOUS1czTF7l9OyWwxBlERrs49xL t45A== X-Gm-Message-State: AIVw110I+bQ/PrgluXu08myZuoMQ0+MlZ1MdjUEe4SyEanaWMvRTqgOs i0X2gOQ/GJ3R5nP7 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 Cc: Jaroslav Kysela , Takashi Iwai , Patrick Lai , linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v1 1/6] ASoC: jack: fix snd_soc_codec_set_jack return error 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.3 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);