diff options
author | Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> | 2016-04-14 13:04:56 +0530 |
---|---|---|
committer | Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> | 2016-04-14 13:11:33 +0530 |
commit | 80c4a068544463b171a1682fb3758af62811e5a3 (patch) | |
tree | 889be1161c9997a2eebb8d69ac3deecb3496f691 | |
parent | 78011be425eb5319039ebaaefc7b316d0e3b2ff4 (diff) | |
download | occ-inband-sensors-80c4a068544463b171a1682fb3758af62811e5a3.tar.gz occ-inband-sensors-80c4a068544463b171a1682fb3758af62811e5a3.zip |
sensor: Fix the chip initialization
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
-rw-r--r-- | sensor.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -211,6 +211,16 @@ static int init_chip(void) unsigned int id = cpu_to_chip_id(cpu); if (prev_chip_id != id) { + bool id_added = false; + int j; + + for (j = 0; j < nr_chips; j++) + if (chip[j] == id) { + id_added = true; + break; + } + if (id_added) + continue; prev_chip_id = id; chip[nr_chips++] = id; } |