提交 d03e0f27 编写于 作者: K Karol Herbst 提交者: Ben Skeggs

drm/nouveau/iccsense: remove read function

Signed-off-by: NKarol Herbst <nouveau@karolherbst.de>
Reviewed-by: NMartin Peres <martin.peres@free.fr>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册