summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorPreetham Chandru R <pchandru@nvidia.com>2013-12-27 18:53:27 +0530
committerPreetham Chandru <pchandru@nvidia.com>2014-01-15 23:24:35 -0800
commit078a8c3f81f65f68b0a48e0480759019548276ab (patch)
treeb19c03949614707f3caf052e82feccb8be3ba239 /drivers/thermal
parent842bf3f98a79d045a38dc1f5690221d4cbc0f871 (diff)
thermal: tmp006: fail probe if device not present
Fail probe if device is not present Bug 1397494 Change-Id: If7609423db3e72d01315480709da923786969d4a Signed-off-by: Preetham Chandru R <pchandru@nvidia.com> Reviewed-on: http://git-master/r/350182 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/tmp006.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/thermal/tmp006.c b/drivers/thermal/tmp006.c
index 3fc2e0db5b31..c0d401bcae46 100644
--- a/drivers/thermal/tmp006.c
+++ b/drivers/thermal/tmp006.c
@@ -444,6 +444,15 @@ static int tmp006_probe(struct i2c_client *client,
return err;
}
i2c_set_clientdata(client, data);
+
+ if (tmp006_get_manufacture_id(client) != 0x5449 ||
+ tmp006_get_device_id(client) != 0x0067) {
+ dev_err(&client->dev,
+ "%s(): tmp006 device not present\n",
+ __func__, err);
+ return -1;
+ }
+
data->thz_dev = thermal_zone_device_register("tmp006", 1, 0, data,
&tmp006_dev_ops, NULL, 0, TMP006_POLL_INT);
if (IS_ERR(data->thz_dev)) {
@@ -452,6 +461,7 @@ static int tmp006_probe(struct i2c_client *client,
"\n thermal_zone_device_register error err=%d ", err);
return err;
}
+
return 0;
}