From: Karol Herbst Date: Mon, 28 Mar 2016 12:24:29 +0000 (+0200) Subject: drm/nouveau/iccsense: remove read function X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d03e0f2748a7da3911fd54af16eb07f325ce830f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/nouveau/iccsense: remove read function Signed-off-by: Karol Herbst Reviewed-by: Martin Peres Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/iccsense.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/iccsense.h index 530c6215fe4f..c3defcd34d51 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/iccsense.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/iccsense.h @@ -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 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