diff options
author | Karol Herbst <nouveau@karolherbst.de> | 2016-03-28 14:24:29 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-05-20 14:43:04 +1000 |
commit | d03e0f2748a7da3911fd54af16eb07f325ce830f (patch) | |
tree | 5542279ef6bd6e816748360d0963b8d79c682d7f /drivers/gpu/drm/nouveau/nvkm/subdev/iccsense | |
parent | 7d28dbae228d16b28b6af98bf020effabfb7e0b0 (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/iccsense')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c index c44a85228074..bf1b94ec6ed4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c @@ -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 |