From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E6132B7BD9 for ; Fri, 4 Dec 2009 13:41:17 +1100 (EST) Received: from [IPv6:::1] (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id nB42fC99004570 for ; Thu, 3 Dec 2009 20:41:13 -0600 Subject: [Fwd: [PATCH] therm_adt746x: Don't access non-existing register] From: Benjamin Herrenschmidt To: linuxppc-dev Content-Type: multipart/mixed; boundary="=-jZQoKJJPfpqAGU5OknZd" Date: Fri, 04 Dec 2009 13:41:06 +1100 Message-ID: <1259894466.2076.1247.camel@pasglop> Mime-Version: 1.0 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --=-jZQoKJJPfpqAGU5OknZd Content-Type: text/plain Content-Transfer-Encoding: 7bit --=-jZQoKJJPfpqAGU5OknZd Content-Disposition: inline Content-Description: Forwarded message - [PATCH] therm_adt746x: Don't access non-existing register Content-Type: message/rfc822 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on gate.crashing.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FORGED_RCVD_HELO autolearn=unavailable version=3.1.9 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id nB28K2jw029035 for ; Wed, 2 Dec 2009 02:20:04 -0600 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752034AbZLBITs (ORCPT ); Wed, 2 Dec 2009 03:19:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751067AbZLBITs (ORCPT ); Wed, 2 Dec 2009 03:19:48 -0500 Received: from bamako.nerim.net ([62.4.17.28]:59080 "EHLO bamako.nerim.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750894AbZLBITr (ORCPT ); Wed, 2 Dec 2009 03:19:47 -0500 Received: from localhost (localhost [127.0.0.1]) by bamako.nerim.net (Postfix) with ESMTP id A424939DEFA; Wed, 2 Dec 2009 09:19:51 +0100 (CET) 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 XlC-ZSpy63cA; Wed, 2 Dec 2009 09:19:50 +0100 (CET) Received: from hyperion.delvare (jdelvare.pck.nerim.net [62.212.121.182]) by bamako.nerim.net (Postfix) with ESMTP id 6D16A39DE46; Wed, 2 Dec 2009 09:19:50 +0100 (CET) Date: Wed, 2 Dec 2009 09:19:51 +0100 From: Jean Delvare To: Michel =?ISO-8859-15?B?RORuemVy?= , "Darrick J. Wong" Cc: Benjamin Herrenschmidt , LKML , Colin Leroy , Paul Mackerras Subject: [PATCH] therm_adt746x: Don't access non-existing register Message-ID: <20091202091951.5ec6bb83@hyperion.delvare> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; i586-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Michel, Darrick, Apparently you are using the therm_adt746x driver, so maybe you would be interested in testing and carrying the following patch. I've sent it to Colin Leroy, who is listed as the maintainer for this driver, 1.5 month ago, but did not hear back. * * * * * 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 Tested-by: Tim Shepard Cc: Colin Leroy Cc: Benjamin Herrenschmidt Cc: Paul Mackerras --- 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); -- Jean Delvare -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ --=-jZQoKJJPfpqAGU5OknZd--