Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751991AbdHBRKO (ORCPT ); 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 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 977 Lines: 29 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); -- 2.9.3