From patchwork Wed Oct 14 18:59:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Shepard X-Patchwork-Id: 36028 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 D46A7B7E18 for ; Thu, 15 Oct 2009 08:04:41 +1100 (EST) Received: by ozlabs.org (Postfix) id 5EB26B7E4E; Thu, 15 Oct 2009 06:23:03 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org X-Greylist: delayed 1399 seconds by postgrey-1.32 at bilbo; Thu, 15 Oct 2009 06:23:03 EST Received: from alva.home (dsl092-066-146.bos1.dsl.speakeasy.net [66.92.66.146]) by ozlabs.org (Postfix) with ESMTP id 13811B7E2B for ; Thu, 15 Oct 2009 06:23:02 +1100 (EST) Received: from shep (helo=alva.home) by alva.home with local-esmtp (Exim 3.36 #1 (Debian)) id 1My94C-0002GE-00; Wed, 14 Oct 2009 14:59:20 -0400 From: Tim Shepard To: Jean Delvare Subject: Re: [PATCH] therm_adt746x: Don't access non-existing register In-reply-to: Your message of Wed, 14 Oct 2009 17:31:32 +0200. <20091014173132.2894d0fd@hyperion.delvare> Date: Wed, 14 Oct 2009 14:59:20 -0400 Message-Id: X-Mailman-Approved-At: Thu, 15 Oct 2009 08:04:35 +1100 Cc: Colin Leroy , 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: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Jean, I tried one reboot with your patch, failed as usual. (Patch sounds like a good idea though.) -Tim Shepard shep@alum.mit.edu tree<11>$ git describe v2.6.31.1-6-g0b193bc tree<12>$ git diff HEAD^ HEAD tree<13>$ dmesg | head Using PowerMac machine description Total memory = 1536MB; using 4096kB for hash table (at cfc00000) Linux version 2.6.31.1-00006-g0b193bc (shep@tree) (gcc version 4.3.2 (Debian 4.3.2-1.1) ) #9 Wed Oct 14 13:41:40 EDT 2009 Found UniNorth memory controller & host bridge @ 0xf8000000 revision: 0xd9 Mapped at 0xff7c0000 Found a Intrepid mac-io controller, rev: 0, mapped at 0xff740000 Processor NAP mode on idle enabled. PowerMac motherboard: PowerBook G4 15" console [udbg0] enabled Found UniNorth PCI host bridge at 0x00000000f0000000. Firmware bus number: 0->1 tree<14>$ dmesg | grep adt adt746x: version 1 (supported) adt746x: Thermostat bus: 0, address: 0x2e, limit_adjust: 0, fan_speed: -1 therm_adt746x 7-002e: Thermostat failed to read config! tree<15>$ diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 0554dae..bf9ed2d 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c @@ -366,7 +366,7 @@ static int probe_thermostat(struct i2c_client *client, 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);