X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/nv-tegra/linux-3.10.git/blobdiff_plain/458d45cbf0fd1bcf95113166769753ea35deed24..baaa7aad03a9a49fb86f5f58c783920b906b0ee2:/drivers/misc/nct1008.c diff --git a/drivers/misc/nct1008.c b/drivers/misc/nct1008.c index b23ee9f9f42..7761f6b3907 100644 --- a/drivers/misc/nct1008.c +++ b/drivers/misc/nct1008.c @@ -1340,22 +1340,6 @@ static int nct1008_configure_sensor(struct nct1008_data *data) if (ret) goto error; - /* Initiate one-shot conversion */ - nct1008_write_reg(data->client, ONE_SHOT, 0x1); - - /* Give hardware necessary time to finish conversion */ - msleep(MAX_CONV_TIME_ONESHOT_MS); - - /* read initial temperature */ - ret = nct1008_read_reg(client, LOC_TEMP_RD); - if (ret < 0) - goto error; - else - value = ret; - - temp = value_to_temperature(pdata->extended_range, value); - dev_dbg(&client->dev, "\n initial local temp = %d ", temp); - if (ext_err) return ext_err; /* skip configuration of EXT sensor */ @@ -1375,6 +1359,25 @@ static int nct1008_configure_sensor(struct nct1008_data *data) if (ret) goto error; + /* Initiate one-shot conversion */ + ret = nct1008_write_reg(data->client, ONE_SHOT, 0x1); + if (ret) + goto error; + + /* Give hardware necessary time to finish conversion */ + msleep(MAX_CONV_TIME_ONESHOT_MS); + + /* read initial local temperature */ + ret = nct1008_read_reg(client, LOC_TEMP_RD); + if (ret < 0) + goto error; + else + value = ret; + + temp = value_to_temperature(pdata->extended_range, value); + dev_dbg(&client->dev, "\n initial local temp = %d ", temp); + + /* read initial ext temperature */ ret = nct1008_read_reg(client, EXT_TEMP_LO_RD); if (ret < 0) goto error;