drm/nouveau/iccsense: remove read function

Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
Karol Herbst 2016-03-28 14:24:29 +02:00 committed by Ben Skeggs
parent 7d28dbae22
commit d03e0f2748
2 changed files with 13 additions and 17 deletions

View File

@ -12,6 +12,5 @@ struct nvkm_iccsense {
};
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

View File

@ -95,27 +95,24 @@ nvkm_iccsense_ina3221_read(struct nvkm_iccsense *iccsense,
40 * 8);
}
int
nvkm_iccsense_read(struct nvkm_iccsense *iccsense, u8 idx)
{
struct nvkm_iccsense_rail *rail;
if (!iccsense || idx >= iccsense->rail_count)
return -EINVAL;
rail = &iccsense->rails[idx];
if (!rail->read)
return -ENODEV;
return rail->read(iccsense, rail);
}
int
nvkm_iccsense_read_all(struct nvkm_iccsense *iccsense)
{
int result = 0, i;
if (!iccsense)
return -EINVAL;
if (iccsense->rail_count == 0)
return -ENODEV;
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