From patchwork Tue May 10 23:44:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1431 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:51:57 -0000 Delivered-To: patches@linaro.org Received: by 10.224.61.3 with SMTP id r3cs38885qah; Tue, 10 May 2011 16:44:52 -0700 (PDT) Received: by 10.42.171.9 with SMTP id h9mr3233095icz.37.1305071092016; Tue, 10 May 2011 16:44:52 -0700 (PDT) Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id uf9si21249510icb.85.2011.05.10.16.44.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 May 2011 16:44:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linus.ml.walleij@gmail.com designates 209.85.214.178 as permitted sender) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linus.ml.walleij@gmail.com designates 209.85.214.178 as permitted sender) smtp.mail=linus.ml.walleij@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by iwn9 with SMTP id 9so7264941iwn.37 for ; Tue, 10 May 2011 16:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=x/a9v8oWyPwcpg12TZBT4H4AmVzE4bdsyHTpK5NteUI=; b=BzNE/E7XP7Yk4uLp0DVp6wqWw0105LhXx3+B/yLV9PdGBcCWQ6d0deL96vpX2p7SIG z15T5jbYiUq7IwTXaxPFzF+rSHM8A9Vi13N6lwSmhNM0lh0j5Ufh0O6zXzMGy3nKCMh4 7xLx//qoWAauWzgavARqo9z/QgLCwwbvWzekU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=QLUrKmE7iYxylQVbaNyW4XrFOM1/VJfndbcMlmadMJ9i01+Jxy6D44jQWItQunD4Vb 1nUUjgSUWBQ51FBdv61+vHT0tJ/HulKX/TRU9ZJrEiKyLnCMc506artu5AgK17ewh1f/ ijmLqgLKin6/AquoP92+2qItktsAQrmx6fnVo= MIME-Version: 1.0 Received: by 10.42.9.29 with SMTP id k29mr8409097ick.97.1305071091755; Tue, 10 May 2011 16:44:51 -0700 (PDT) Received: by 10.231.20.3 with HTTP; Tue, 10 May 2011 16:44:51 -0700 (PDT) In-Reply-To: <1304976972-31513-1-git-send-email-linus.walleij@linaro.org> References: <1304976972-31513-1-git-send-email-linus.walleij@linaro.org> Date: Wed, 11 May 2011 01:44:51 +0200 Message-ID: Subject: Fwd: [PATCH 04/13] i2c/i2c-nomadik: corrrect returned error numbers From: Linus Walleij To: patches@linaro.org ---------- Forwarded message ---------- From: Linus Walleij Date: 2011/5/9 Subject: [PATCH 04/13] i2c/i2c-nomadik: corrrect returned error numbers To: Ben Dooks , linux-i2c@vger.kernel.org Kopia: Virupax Sadashivpetimath , Linus Walleij From: Virupax Sadashivpetimath The code was returning bad error numbers or just -1 in some cases. Signed-off-by: Virupax Sadashivpetimath Reviewed-by: Srinidhi Kasagar Signed-off-by: Linus Walleij ---  drivers/i2c/busses/i2c-nomadik.c |   10 ++++++----  1 files changed, 6 insertions(+), 4 deletions(-) -- 1.7.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 3bf95b9..a02141a 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -615,6 +615,8 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,                                cause >= ARRAY_SIZE(abort_causes)                                ? "unknown reason" : abort_causes[cause]); +                       status = status ? status : dev->result; +                        goto out;                }                udelay(I2C_DELAY); @@ -759,7 +761,7 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)                                        | I2C_IT_RXFF | I2C_IT_RXFE));                if (dev->cli.count) { -                       dev->result = -1; +                       dev->result = -EIO;                        dev_err(&dev->pdev->dev, "%lu bytes still remain to be"                                        "xfered\n", dev->cli.count);                        (void) init_hw(dev); @@ -770,7 +772,7 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)        /* Master Arbitration lost interrupt */        case I2C_IT_MAL: -               dev->result = -1; +               dev->result = -EIO;                (void) init_hw(dev);                i2c_set_bit(dev->virtbase + I2C_ICR, I2C_IT_MAL); @@ -784,7 +786,7 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)         * during the transaction.         */        case I2C_IT_BERR: -               dev->result = -1; +               dev->result = -EIO;                /* get the status */                if (((readl(dev->virtbase + I2C_SR) >> 2) & 0x3) == I2C_ABORT)                        (void) init_hw(dev); @@ -800,7 +802,7 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg)         * the Tx FIFO is full.         */        case I2C_IT_TXFOVR: -               dev->result = -1; +               dev->result = -EIO;                (void) init_hw(dev);                dev_err(&dev->pdev->dev, "Tx Fifo Over run\n");