powerpc/therm_adt746x: Don't access non-existing register

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 <[email protected]>
Cc: Colin Leroy <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
This commit is contained in:
Jean Delvare 2009-10-14 05:31:32 +00:00 • committed by Benjamin Herrenschmidt
commit 99ca177ae4

View file

@ -387,7 +387,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);