From patchwork Fri Dec 31 14:57:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 77086 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 8CD13100A1F for ; Sat, 1 Jan 2011 01:57:59 +1100 (EST) Received: from mail-ew0-f51.google.com (mail-ew0-f51.google.com [209.85.215.51]) by ozlabs.org (Postfix) with ESMTP id 4959FB6EF2 for ; Sat, 1 Jan 2011 01:57:51 +1100 (EST) Received: by ewy19 with SMTP id 19so5027655ewy.38 for ; Fri, 31 Dec 2010 06:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=xBQ1QkQ9ibUKe9nWILWGTDYl4oWTmffKnxkOmac75lc=; b=mbz5Yk2kRw9l9GhF8sHGktaKp4ShyZwES9UkmbmQQxlQd+9xX9fxRJ23yGrD6lfAMC nZavnEUfELRjkGlDQgfS6PjzwvGQ/x2ztwZTeZKRveosqorynCMSm/+haAUvwlW1t4AQ kHPRpA9oARsOBabAQ/2EmQmY5qNt+qq76PfCQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=atw8Muq91MFcG/tyv/1d/L48TytwHnDv2b5+707U90CntGa/d7dJ1USEylDfX67Ku8 HPBnVa3GUeFnT/r0TfccLoh1ivtH8pkVx3no6Xl3AGC+GkuB7CHsSVjNI8rUcPOTvPU5 KbWsiV8QH3T886hmKoQB0HjNoNSASxJ5FlGo8= Received: by 10.213.9.66 with SMTP id k2mr2044961ebk.23.1293807467956; Fri, 31 Dec 2010 06:57:47 -0800 (PST) Received: from [192.168.1.7] (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id u1sm12345335eeh.16.2010.12.31.06.57.46 (version=SSLv3 cipher=RC4-MD5); Fri, 31 Dec 2010 06:57:47 -0800 (PST) Message-ID: <4D1DEF6A.5090502@gmail.com> Date: Fri, 31 Dec 2010 15:57:46 +0100 From: roel kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, Andrew Morton , LKML Subject: [PATCH] macintosh: wrong test in fan_{read,write}_reg() X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Fix error test in fan_{read,write}_reg() Signed-off-by: Roel Kluin --- drivers/macintosh/therm_pm72.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) ENODEV and EIO are positive (22 and 8), so the tests did not work. diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index 4454927..6256a08 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c @@ -443,7 +443,7 @@ static int fan_read_reg(int reg, unsigned char *buf, int nb) tries = 0; for (;;) { nr = i2c_master_recv(fcu, buf, nb); - if (nr > 0 || (nr < 0 && nr != ENODEV) || tries >= 100) + if (nr > 0 || (nr < 0 && nr != -ENODEV) || tries >= 100) break; msleep(10); ++tries; @@ -464,7 +464,7 @@ static int fan_write_reg(int reg, const unsigned char *ptr, int nb) tries = 0; for (;;) { nw = i2c_master_send(fcu, buf, nb); - if (nw > 0 || (nw < 0 && nw != EIO) || tries >= 100) + if (nw > 0 || (nw < 0 && nw != -EIO) || tries >= 100) break; msleep(10); ++tries;