From patchwork Wed Aug 2 17:09:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 109264 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp6474082obm; Wed, 2 Aug 2017 10:10:57 -0700 (PDT) X-Received: by 10.84.172.1 with SMTP id m1mr25399114plb.174.1501693856945; Wed, 02 Aug 2017 10:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501693856; cv=none; d=google.com; s=arc-20160816; b=p0gDqEFkx04HI8kUeOtx8K5J8S9Z0TUUkqyppUAX6DYY841H6MuteLo9SAvC/N6cuY 74aiDUParS9zCCczB51EVD7glVCU78i01W27RRHVmZOnUyqtrT+x0uEfDqBRnxyzoOQN PV1VoI2liFrfplCIbR95zPy2mAlHDBYA5em8ea6DFF9eWylkeU/DMBz/EecSQ0SiBBjj MbSCmvLpzg78uHgIduFSq1XGjI6KJk8CaTkto6bg1uWFVrULM4gYIFFqQGTell8R/E8v /SH9AcG9tsiCjjLhH3i+HNHt4lDBl6MTh2kmSzFq9PparyIy0CRoRKiRwSsEhQA9XsTT 60tQ== 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=vIOCSDp3uxQ4GRBKXQ5YykAJJ89S3efoUR4ZDLcW7u6K+MlIeUhzTTo03Q61HSjPxl X5/nN7Eu09Mszzn/+LQvMcItSI0ZZ/Y7OE2GXP/0UeKQdta1ZkczCeoPxnOphG0hABsx 5luAAz772cWJDQ5lxNOMqOXwC47/RQzSC8EoJIhvYwiyMbbksAESw5OG6fE90FR1uwy7 2CgRjfDDzu8fO3v9oF5Zbxa0uhrn5LmReQHEU8GcQoHULoMrwsuXOWj5H+RQe6JlcRMp eAOSEkz4e9GalHG+FtjBYLCv/RsQaehKmoSYJJ1UfJVXArVC1wiGiPoklszG2AiF1plk bkYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=BO3yYEI9; 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 f3si21609532plb.850.2017.08.02.10.10.56; Wed, 02 Aug 2017 10:10:56 -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=BO3yYEI9; 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 S1752790AbdHBRKO (ORCPT + 25 others); Wed, 2 Aug 2017 13:10:14 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:37004 "EHLO mail-it0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752146AbdHBRJo (ORCPT ); Wed, 2 Aug 2017 13:09:44 -0400 Received: by mail-it0-f49.google.com with SMTP id v127so28138104itd.0 for ; Wed, 02 Aug 2017 10:09:44 -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=BO3yYEI9ZR351lzkEIwdJMD0EKeJTezLvAl0sus4JySxln7/DaWQDwM8VmXTlbduJY R5Uw1+MS51fuQ+okoGuqjx1+dVnbPgOT37zcDyifVKMdcjzEIsC+piqogU75U0PHH253 lUy2cm04PniVNyAU0enP1/4x0DVtTPO+MewZc= 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=HAPXDVHrlhwhk0ngGr8evO9DfXBwFp/rY2kd2XL7klcKua62chxNkJNl31Lyl9IN0w qkMbqghLawvnnMBUlm0LX0SnRsahXS/NFfaf9KT9AmRG9ef6JrzVY7aFmz/zFiECZjK3 b5iOqzBMgxjjVUXS57Fls7j2ewlMe+8zMPn+4LqHSsaEF6xwnh8qVUxrLvGRX8XpbHS1 qS6IrCrw1L1VnV/GweFz1JHr4AHW0PFvS2F1tMyzdubPYlrb/ZoKwXvjOxsviHAzbFcZ b7plKb1YiCwGZbKgwyaKHcohm1yE58Nt2sWWVZh8oLn59Ol/XdYygsTTWlk0GkT5CxSk 7q1g== X-Gm-Message-State: AIVw112KIPqH0hCy+zrrmrLUS1cEnw5aL87ip3sKbhBW1XgaQSIo1ly6 u3jTkOtlJNip73A7TKzrtQ== X-Received: by 10.36.49.7 with SMTP id y7mr6305760ity.72.1501693784080; Wed, 02 Aug 2017 10:09:44 -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 u79sm2291222ita.24.2017.08.02.10.09.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 10:09:43 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Mark Brown , Banajit Goswami , alsa-devel@alsa-project.org Cc: damien.riegel@savoirfairelinux.com, Jaroslav Kysela , Takashi Iwai , Patrick Lai , linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v2 1/6] ASoC: jack: fix snd_soc_codec_set_jack return error Date: Wed, 2 Aug 2017 19:09:25 +0200 Message-Id: <20170802170930.26083-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170802170930.26083-1-srinivas.kandagatla@linaro.org> References: <20170802170930.26083-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);