From patchwork Tue May 10 23:45:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1434 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:58 -0000 Delivered-To: patches@linaro.org Received: by 10.224.61.3 with SMTP id r3cs38895qah; Tue, 10 May 2011 16:45:29 -0700 (PDT) Received: by 10.42.250.66 with SMTP id mn2mr4582507icb.82.1305071128676; Tue, 10 May 2011 16:45:28 -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.45.28 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 May 2011 16:45:28 -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 mail-iw0-f178.google.com with SMTP id 9so7264941iwn.37 for ; Tue, 10 May 2011 16:45:28 -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=K5NozSN6in5gGC0fTrRYbS5A4N23RisP4qXmkwFiQcU=; b=GAkCdRCylg58qPmnGMCCqfeql/MMPIs9B8iErX6LJDU2rEITgCkzWnVH+2nKgKjbHL 1LxMjX1qtDOq0/QkbjGUwr8BLU/v9I6q2VAiO0/DiYnmu0l7FBUw1To3ZcpoXbgfdusj Arg1JSdEDQJPRMwX6YS2orp/XL5ul6Z9mKXIQ= 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=Ol8TT52ZSk83tmFlVyA2JGQu0e+HLyFnAD/gcYBoQF98g9AbpDFM875Nh48RndYWYv U5BzFGt/5ey8iypSUB10tELVtAnLn4Y/E+yMQ/0EdhFd+dfstMpFB2M4xM6yBEuVCo7m HLvMMtCIna4wVp41f/CAAJJnk62Q/CwYHK4H0= MIME-Version: 1.0 Received: by 10.42.150.70 with SMTP id z6mr2706977icv.164.1305071127377; Tue, 10 May 2011 16:45:27 -0700 (PDT) Received: by 10.231.20.3 with HTTP; Tue, 10 May 2011 16:45:27 -0700 (PDT) In-Reply-To: <1304977027-31587-1-git-send-email-linus.walleij@linaro.org> References: <1304977027-31587-1-git-send-email-linus.walleij@linaro.org> Date: Wed, 11 May 2011 01:45:27 +0200 Message-ID: Subject: Fwd: [PATCH 06/13] i2c/i2c-nomadik: correct adapter timeout initialization From: Linus Walleij To: patches@linaro.org ---------- Forwarded message ---------- From: Linus Walleij Date: 2011/5/9 Subject: [PATCH 06/13] i2c/i2c-nomadik: correct adapter timeout initialization To: Ben Dooks , linux-i2c@vger.kernel.org Kopia: Virupax Sadashivpetimath , Linus Walleij From: Virupax Sadashivpetimath Correct the incorrect initialization of adapter timeout not to be in milliseconds, as it needs to be done in jiffies. Signed-off-by: Virupax Sadashivpetimath Reviewed-by: Srinidhi Kasagar Signed-off-by: Linus Walleij ---  drivers/i2c/busses/i2c-nomadik.c |    9 +++++----  1 files changed, 5 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 dbd93b2..28389c2 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -210,7 +210,7 @@ static int flush_i2c_fifo(struct nmk_i2c_dev *dev)        writel((I2C_CR_FTX | I2C_CR_FRX), dev->virtbase + I2C_CR);        for (i = 0; i < LOOP_ATTEMPTS; i++) { -               timeout = jiffies + msecs_to_jiffies(dev->adap.timeout); +               timeout = jiffies + dev->adap.timeout;                while (!time_after(jiffies, timeout)) {                        if ((readl(dev->virtbase + I2C_CR) & @@ -431,7 +431,7 @@ static int read_i2c(struct nmk_i2c_dev *dev)                        dev->virtbase + I2C_IMSCR);        timeout = wait_for_completion_interruptible_timeout( -               &dev->xfer_complete, msecs_to_jiffies(dev->adap.timeout)); +               &dev->xfer_complete, dev->adap.timeout);        if (timeout < 0) {                dev_err(&dev->pdev->dev, @@ -495,7 +495,7 @@ static int write_i2c(struct nmk_i2c_dev *dev)                        dev->virtbase + I2C_IMSCR);        timeout = wait_for_completion_interruptible_timeout( -               &dev->xfer_complete, msecs_to_jiffies(dev->adap.timeout)); +               &dev->xfer_complete, dev->adap.timeout);        if (timeout < 0) {                dev_err(&dev->pdev->dev, @@ -914,7 +914,8 @@ static int __devinit nmk_i2c_probe(struct platform_device *pdev)        adap->owner     = THIS_MODULE;        adap->class     = I2C_CLASS_HWMON | I2C_CLASS_SPD;        adap->algo      = &nmk_i2c_algo; -       adap->timeout   = pdata->timeout ? pdata->timeout : 20000; +       adap->timeout   = pdata->timeout ? msecs_to_jiffies(pdata->timeout) : +               msecs_to_jiffies(20000);        snprintf(adap->name, sizeof(adap->name),                 "Nomadik I2C%d at %lx", pdev->id, (unsigned long)res->start);