From patchwork Wed Oct 14 15:31:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Delvare X-Patchwork-Id: 35984 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 CB11CB7F3F for ; Thu, 15 Oct 2009 02:31:44 +1100 (EST) Received: by ozlabs.org (Postfix) id DB9F5B7B9D; Thu, 15 Oct 2009 02:31:37 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from bamako.nerim.net (bamako.nerim.net [62.4.17.28]) by ozlabs.org (Postfix) with ESMTP id 90916B7B92 for ; Thu, 15 Oct 2009 02:31:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by bamako.nerim.net (Postfix) with ESMTP id A9F4F39DE84; Wed, 14 Oct 2009 17:31:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at nerim.net Received: from bamako.nerim.net ([127.0.0.1]) by localhost (bamako.nerim.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uzAIQebmD58q; Wed, 14 Oct 2009 17:31:30 +0200 (CEST) Received: from hyperion.delvare (jdelvare.pck.nerim.net [62.212.121.182]) by bamako.nerim.net (Postfix) with ESMTP id A050E39DE5A; Wed, 14 Oct 2009 17:31:30 +0200 (CEST) Date: Wed, 14 Oct 2009 17:31:32 +0200 From: Jean Delvare To: Colin Leroy , Tim Shepard Subject: [PATCH] therm_adt746x: Don't access non-existing register Message-ID: <20091014173132.2894d0fd@hyperion.delvare> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; i586-suse-linux-gnu) Mime-Version: 1.0 Cc: linuxppc-dev@ozlabs.org, Paul Mackerras X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 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 The ADT746x don't have any register at sub-address 0, so better use an existing register for the initial test read. Signed-off-by: Jean Delvare Cc: Colin Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras --- Tim, I don't really expect this to solve your problem, but who knows... Care to give it a try, just in case? drivers/macintosh/therm_adt746x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-2.6.32-rc4.orig/drivers/macintosh/therm_adt746x.c 2009-10-12 11:53:59.000000000 +0200 +++ linux-2.6.32-rc4/drivers/macintosh/therm_adt746x.c 2009-10-14 17:27:46.000000000 +0200 @@ -387,7 +387,7 @@ static int probe_thermostat(struct i2c_c i2c_set_clientdata(client, th); th->clt = client; - rc = read_reg(th, 0); + rc = read_reg(th, CONFIG_REG); if (rc < 0) { dev_err(&client->dev, "Thermostat failed to read config!\n"); kfree(th);