};
int gf100_iccsense_new(struct nvkm_device *, int index, struct nvkm_iccsense **);
-int nvkm_iccsense_read(struct nvkm_iccsense *iccsense, u8 idx);
int nvkm_iccsense_read_all(struct nvkm_iccsense *iccsense);
#endif
}
int
-nvkm_iccsense_read(struct nvkm_iccsense *iccsense, u8 idx)
+nvkm_iccsense_read_all(struct nvkm_iccsense *iccsense)
{
- struct nvkm_iccsense_rail *rail;
+ int result = 0, i;
- if (!iccsense || idx >= iccsense->rail_count)
+ if (!iccsense)
return -EINVAL;
- rail = &iccsense->rails[idx];
- if (!rail->read)
+ if (iccsense->rail_count == 0)
return -ENODEV;
- return rail->read(iccsense, rail);
-}
-
-int
-nvkm_iccsense_read_all(struct nvkm_iccsense *iccsense)
-{
- int result = 0, i;
for (i = 0; i < iccsense->rail_count; ++i) {
- int res = nvkm_iccsense_read(iccsense, i);
+ int res;
+ struct nvkm_iccsense_rail *rail = &iccsense->rails[i];
+ if (!rail->read)
+ return -ENODEV;
+
+ res = rail->read(iccsense, rail);
if (res >= 0)
result += res;
else