diff options
author | seshendra Gadagottu <sgadagottu@nvidia.com> | 2016-07-14 14:43:53 -0400 |
---|---|---|
committer | Seshendra Gadagottu <sgadagottu@nvidia.com> | 2016-07-25 20:10:03 -0400 |
commit | 021c23e46eb69ee2c888fa3b05834f110da7a450 (patch) | |
tree | 400c12e9a2b87402bab2b02aee3f111f4077aa4c /drivers/gpu/nvgpu/gk20a/gk20a_scale.c | |
parent | e2b965e555255be64a7687bd21e0f4ae1a17fe55 (diff) |
gpu: nvgpu: check for valid function pointers
Before calling prod settings functions, check for
availability of those functions.
Similar check is extended for get_clk_freqs.
Bug 1735760
Change-Id: Ic4b38079043ab2049a479a2d8bb0cb6091e94f4a
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/1181571
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_scale.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index eeabd919..ec9ca5db 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c | |||
@@ -118,10 +118,13 @@ static int gk20a_scale_make_freq_table(struct gk20a_scale_profile *profile) | |||
118 | int num_freqs, err; | 118 | int num_freqs, err; |
119 | unsigned long *freqs; | 119 | unsigned long *freqs; |
120 | 120 | ||
121 | /* get gpu frequency table */ | 121 | if (platform->get_clk_freqs) { |
122 | err = platform->get_clk_freqs(profile->dev, &freqs, | 122 | /* get gpu frequency table */ |
123 | err = platform->get_clk_freqs(profile->dev, &freqs, | ||
123 | &num_freqs); | 124 | &num_freqs); |
124 | if (err) | 125 | if (err) |
126 | return -ENOSYS; | ||
127 | } else | ||
125 | return -ENOSYS; | 128 | return -ENOSYS; |
126 | 129 | ||
127 | profile->devfreq_profile.freq_table = (unsigned long *)freqs; | 130 | profile->devfreq_profile.freq_table = (unsigned long *)freqs; |