Commit d03e0f27 authored by Karol Herbst's avatar Karol Herbst Committed by Ben Skeggs

drm/nouveau/iccsense: remove read function

Signed-off-by: default avatarKarol Herbst <nouveau@karolherbst.de>
Reviewed-by: default avatarMartin Peres <martin.peres@free.fr>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 7d28dbae
......@@ -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
......@@ -96,26 +96,23 @@ nvkm_iccsense_ina3221_read(struct nvkm_iccsense *iccsense,
}
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment