From e1560662565d226ba5b8052dad04877877860ca5 Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Wed, 31 Oct 2018 10:52:15 -0400 Subject: [PATCH] gpu: nvgpu: fuse: return int for cal APIs The APIs read_vin_cal_slope_intercept_fuse() and read_vin_cal_gain_offset_fuse() where prototyped for u32 return types, but they were actually returning negative errno's for errors. Change the return type to int so the errors can be checked properly. clk_vin.c still stores the return values as u32's. This will be fixed in a future patch. JIRA NVGPU-938 Change-Id: I4fc47468dcf39f923c4f302919c705b50e10f446 Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/1943383 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fuse/fuse_gp106.c | 4 ++-- drivers/gpu/nvgpu/common/fuse/fuse_gp106.h | 4 ++-- drivers/gpu/nvgpu/include/nvgpu/gk20a.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/nvgpu/common/fuse/fuse_gp106.c b/drivers/gpu/nvgpu/common/fuse/fuse_gp106.c index 1049fff1b..8f6a69f1a 100644 --- a/drivers/gpu/nvgpu/common/fuse/fuse_gp106.c +++ b/drivers/gpu/nvgpu/common/fuse/fuse_gp106.c @@ -44,7 +44,7 @@ u32 gp106_fuse_read_vin_cal_fuse_rev(struct gk20a *g) gk20a_readl(g, fuse_vin_cal_fuse_rev_r())); } -u32 gp106_fuse_read_vin_cal_slope_intercept_fuse(struct gk20a *g, +int gp106_fuse_read_vin_cal_slope_intercept_fuse(struct gk20a *g, u32 vin_id, u32 *slope, u32 *intercept) { @@ -180,7 +180,7 @@ u32 gp106_fuse_read_vin_cal_slope_intercept_fuse(struct gk20a *g, return 0; } -u32 gp106_fuse_read_vin_cal_gain_offset_fuse(struct gk20a *g, +int gp106_fuse_read_vin_cal_gain_offset_fuse(struct gk20a *g, u32 vin_id, s8 *gain, s8 *offset) { diff --git a/drivers/gpu/nvgpu/common/fuse/fuse_gp106.h b/drivers/gpu/nvgpu/common/fuse/fuse_gp106.h index 24be79826..29a437ef0 100644 --- a/drivers/gpu/nvgpu/common/fuse/fuse_gp106.h +++ b/drivers/gpu/nvgpu/common/fuse/fuse_gp106.h @@ -29,10 +29,10 @@ struct gk20a; int gp106_fuse_check_priv_security(struct gk20a *g); u32 gp106_fuse_read_vin_cal_fuse_rev(struct gk20a *g); -u32 gp106_fuse_read_vin_cal_slope_intercept_fuse(struct gk20a *g, +int gp106_fuse_read_vin_cal_slope_intercept_fuse(struct gk20a *g, u32 vin_id, u32 *slope, u32 *intercept); -u32 gp106_fuse_read_vin_cal_gain_offset_fuse(struct gk20a *g, +int gp106_fuse_read_vin_cal_gain_offset_fuse(struct gk20a *g, u32 vin_id, s8 *gain, s8 *offset); diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index d48035611..6a485fa0c 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -1319,10 +1319,10 @@ struct gpu_ops { u32 (*fuse_opt_sec_debug_en)(struct gk20a *g); u32 (*fuse_opt_priv_sec_en)(struct gk20a *g); u32 (*read_vin_cal_fuse_rev)(struct gk20a *g); - u32 (*read_vin_cal_slope_intercept_fuse)(struct gk20a *g, + int (*read_vin_cal_slope_intercept_fuse)(struct gk20a *g, u32 vin_id, u32 *slope, u32 *intercept); - u32 (*read_vin_cal_gain_offset_fuse)(struct gk20a *g, + int (*read_vin_cal_gain_offset_fuse)(struct gk20a *g, u32 vin_id, s8 *gain, s8 *offset); } fuse;