From patchwork Sun Nov 26 16:40:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Beniamino Galvani X-Patchwork-Id: 10075435 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 D358060353 for ; Sun, 26 Nov 2017 16:41:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C56C628A4C for ; Sun, 26 Nov 2017 16:41:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA30428C00; Sun, 26 Nov 2017 16:41:56 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4EEC728A4C for ; Sun, 26 Nov 2017 16:41:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=be9guETUhIUr2glQiQtQStscaTArXIUpUsV3TlqJYAk=; b=q01eUrG4w1XAZFIqn6PQdz+oWG i443eZdtHxBetoc8bCde9GTg7qD6nUMhq3T3Kh3jc0ZWZb2BmySfVs3+d/Y9mXuiLhg9CCq9155Cl EEAxXPaYQcde6C/SM8TsFy0jytPcNUnJt4jJ+2hW1HWsbbY2nHn+8IzZRoVtvrje6tgRPrGa0/mME B7U6XSeucJkHgmlvG32yjvlqalC7/krnoPi2XQbb/dKeVAWtyAVMi7Rcy1yNqjTtvF35JRpNEjVOu TBCY1DekDeyYlSZ5n+DM6NI7ISfxxEySc/G2cb9PD/zY020ozVkXIRCzNWZkL/d9SjZQXa7/SXEqT srGTB0Aw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eJ004-0001R7-HT; Sun, 26 Nov 2017 16:41:48 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eIzzx-0001Fo-Mm for linux-amlogic@lists.infradead.org; Sun, 26 Nov 2017 16:41:43 +0000 Received: by mail-wm0-x241.google.com with SMTP id b189so30380193wmd.5 for ; Sun, 26 Nov 2017 08:41:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YP88p+mfM4KzZyNq/lf/rJHTMo/vjchEKuBJMVhy0Vg=; b=Gfs01U5fX/c614ztUYIkx3Ph+Ks3D/CNed2YPL+qKokJLF9bKCVE1RpDiTr+vJJUut xn006y1zrDvb9kTVpCj/PS6VdqLUYeqny4OF2H6nd031uZdf4rTILK2pQldPUTnK/ykc kDUey+vdJzBc4vh11ootFU7yQptD5+uM7wNC+5KXtua0GnhljkpEb6P5N/8jioDHrg+6 NvgLjT2ZF6I4pXWrachDKRj+TfBemfrnW1bFreRTHR1roTWUllSKKSHc4wHjWGoiZKY9 HtPpm29mQj/+J37TsZp4izbnf2mLu1iZKp8J++uDJMEN3004SyvXzLpmWf4eQ68qGp5W XGng== 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=YP88p+mfM4KzZyNq/lf/rJHTMo/vjchEKuBJMVhy0Vg=; b=t4rGJ5v8HptIDpSCyXjuEAGWoTetlttiR1DcnTI0AXmP06fHuyZK90bccuZyUvf5/5 zqL0ttCfmlGGQUrqc4Bh0DiWufBkb30IRbRre88gSdpvao66+7zJ2+ITXbEi4vfpyNqN 2cASfBM3s8jdzE8FSr/pWq5C9XFBxC/CG9GO+Sm9MToTFPmYs6QsiS5LIeDqOimnadF1 UsbI636Et4IoJbmTxj1B0od9oKyaoCGSLu9UvA5HJ49cQbxllMtDwPtiOPuEOJXjgVLX b+/F+7SJKmyhWN/auwh8mlOESpuwTIpWrsd1HjOSj6m8etIbuYDQ3EBasbwFgOFepF23 GhpA== X-Gm-Message-State: AJaThX53rdgaZ5Z6mVCvTCVJZHhcMiJbxe35JO8RVghbzRrulgrTZWGz c/Vhy7KFxUZgvf4o5YZB50I= X-Google-Smtp-Source: AGs4zMZ/UyGsUDFQvvFdRfcFV6ntXjQ5ta6xzu7creJy0kh2IeCljv9nom4VZaocaL1R0VuX869NKg== X-Received: by 10.28.184.130 with SMTP id i124mr14610001wmf.85.1511714481116; Sun, 26 Nov 2017 08:41:21 -0800 (PST) Received: from sark.homenet.telecomitalia.it (host78-28-dynamic.31-79-r.retail.telecomitalia.it. [79.31.28.78]) by smtp.gmail.com with ESMTPSA id k30sm47874486wrf.63.2017.11.26.08.41.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Nov 2017 08:41:20 -0800 (PST) From: Beniamino Galvani To: u-boot@lists.denx.de Subject: [PATCH 3/4] i2c: meson: fix return codes on error Date: Sun, 26 Nov 2017 17:40:56 +0100 Message-Id: <20171126164057.27728-4-b.galvani@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171126164057.27728-1-b.galvani@gmail.com> References: <20171126164057.27728-1-b.galvani@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171126_084141_899759_F9139DA2 X-CRM114-Status: UNSURE ( 9.49 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Aribaud , trini@konsulko.com, Martin Blumenstingl , Simon Glass , Neil Armstrong , Beniamino Galvani , linux-amlogic@lists.infradead.org, Heiko Schocher , =?UTF-8?q?Andreas=20F=C3=A4rber?= MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Change meson_i2c_xfer_msg() to return -EREMOTEIO in case of NACK, as done by other drivers. Also, don't change the return error in meson_i2c_xfer(). Signed-off-by: Beniamino Galvani Reviewed-by: Simon Glass Reviewed-by: Heiko Schocher --- drivers/i2c/meson_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/meson_i2c.c b/drivers/i2c/meson_i2c.c index 84e1997c76..2f39214ad2 100644 --- a/drivers/i2c/meson_i2c.c +++ b/drivers/i2c/meson_i2c.c @@ -178,7 +178,7 @@ static int meson_i2c_xfer_msg(struct meson_i2c *i2c, struct i2c_msg *msg, if (readl(&i2c->regs->ctrl) & REG_CTRL_ERROR) { debug("meson i2c: error\n"); - return -ENXIO; + return -EREMOTEIO; } if ((msg->flags & I2C_M_RD) && i2c->count) { @@ -200,7 +200,7 @@ static int meson_i2c_xfer(struct udevice *bus, struct i2c_msg *msg, for (i = 0; i < nmsgs; i++) { ret = meson_i2c_xfer_msg(i2c, msg + i, i == nmsgs - 1); if (ret) - return -EREMOTEIO; + return ret; } return 0;