From patchwork Wed Feb 10 14:51:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pascal Huerst X-Patchwork-Id: 8272531 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 97E50BEEE5 for ; Wed, 10 Feb 2016 14:52:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCD90203B1 for ; Wed, 10 Feb 2016 14:52:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A6B672037F for ; Wed, 10 Feb 2016 14:52:13 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C8E3A260731; Wed, 10 Feb 2016 15:52:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8C3CD26067A; Wed, 10 Feb 2016 15:52:05 +0100 (CET) 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 442AB26067A; Wed, 10 Feb 2016 15:52:03 +0100 (CET) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by alsa0.perex.cz (Postfix) with ESMTP id 91A8D260612 for ; Wed, 10 Feb 2016 15:51:56 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id p63so32173567wmp.1 for ; Wed, 10 Feb 2016 06:51:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=kyON6ox1x5mfXFYTbx2ISdwNe0uN4moQb7JiaRC4+KQ=; b=Swl71/UA61i2/YzweHSHhWN4t7LMoffvuqNjpZOoEalTQhLGW7XVobBy/hgx4dnIjI NdgJcwB8IZanYnJtTW+pLOTYFpqg/Lz5WN+G5r457l4zdTksszEn54XJamJOtRLy/mko m3g9xyYYGdK0jkycR9BlLgNMyb5bxfsYxJvI0nPyikhUWZ9xaX3Di7WX2XuJjLu+DSgn SFdA5pPRlaGlmJzJrIrSkpOZ9CKLmkie21yBKgay0QMK/vCoDNLhl6oZnLg9MIO0tNsa DzMyEi3bxeTFh+OYDLHizdE9s9nI6yjHyxkWpupvvwY0gHLLselBKT2c7XtboX5vRUHX eDPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kyON6ox1x5mfXFYTbx2ISdwNe0uN4moQb7JiaRC4+KQ=; b=R/o5l5p0OwHgHy2OiZtph2V16LDnC7CzjYZmk/HbDJofv4t/Ww1Gsi8tIQFqA1xjQp oLcT0n0hQp4SX1pbtVL7ZCRpmSi22h68IhwNgUxeL52bFv8VfA/3At06OjM0MwNXuLK9 eqjxZXrZRfHULaMlOLarK9e4GQA0hRE4Ua3asUWSsez2uKV/6wlCZt0DYTFkEf9mdafS vS3ErMM79/GObCimHfMC2r5XMwCXPLLi+Lh6cg+6bHfBdI/ugU5Ued7OSBVBUWKSTegN LPUIbpA9pebNiQOLHiGIIXdk7W5cJJ8b73zvZM/9UCxy6xuBxft4Q6O83asjNwKp1ciP GY8g== X-Gm-Message-State: AG10YOQxjMt1jcAwdkdzMq3eq9eTKXpLG/sN/w6GMg7h/Qa4wnpjJ4jgLDe64pQEhPs5sg== X-Received: by 10.194.20.105 with SMTP id m9mr39524988wje.161.1455115916379; Wed, 10 Feb 2016 06:51:56 -0800 (PST) Received: from linux-2.fritz.box ([212.91.253.218]) by smtp.gmail.com with ESMTPSA id kb5sm3316528wjc.22.2016.02.10.06.51.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Feb 2016 06:51:55 -0800 (PST) From: pascal.huerst@gmail.com To: lars@metafoo.de Date: Wed, 10 Feb 2016 15:51:30 +0100 Message-Id: <1455115890-23127-1-git-send-email-pascal.huerst@gmail.com> X-Mailer: git-send-email 2.4.3 Cc: alsa-devel@alsa-project.org, Pascal Huerst Subject: [alsa-devel] [PATCH] ASoC: sigmadsp: Fix missleading return value 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: Pascal Huerst Forwarding the return value of i2c_master_send, leads to errors later on, since i2c_master_send returns the number of bytes transmittet. Check for ret < 0 instead and return 0 otherwise. Signed-off-by: Pascal Huerst Acked-by: Lars-Peter Clausen --- sound/soc/codecs/sigmadsp-i2c.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/sigmadsp-i2c.c b/sound/soc/codecs/sigmadsp-i2c.c index 21ca3a5..d374c18 100644 --- a/sound/soc/codecs/sigmadsp-i2c.c +++ b/sound/soc/codecs/sigmadsp-i2c.c @@ -31,7 +31,10 @@ static int sigmadsp_write_i2c(void *control_data, kfree(buf); - return ret; + if (ret < 0) + return ret; + + return 0; } static int sigmadsp_read_i2c(void *control_data,