diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 10 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a_generic.c | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index c91a316a..85864bcd 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1146,7 +1146,9 @@ static int gk20a_pm_enable_clk(struct device *dev) | |||
1146 | return -EINVAL; | 1146 | return -EINVAL; |
1147 | 1147 | ||
1148 | for (index = 0; index < platform->num_clks; index++) { | 1148 | for (index = 0; index < platform->num_clks; index++) { |
1149 | int err = clk_prepare_enable(platform->clk[index]); | 1149 | int err = 0; |
1150 | if (platform->clk[index]) | ||
1151 | clk_prepare_enable(platform->clk[index]); | ||
1150 | if (err) | 1152 | if (err) |
1151 | return -EINVAL; | 1153 | return -EINVAL; |
1152 | } | 1154 | } |
@@ -1163,8 +1165,10 @@ static int gk20a_pm_disable_clk(struct device *dev) | |||
1163 | if (!platform) | 1165 | if (!platform) |
1164 | return -EINVAL; | 1166 | return -EINVAL; |
1165 | 1167 | ||
1166 | for (index = 0; index < platform->num_clks; index++) | 1168 | for (index = 0; index < platform->num_clks; index++) { |
1167 | clk_disable_unprepare(platform->clk[index]); | 1169 | if (platform->clk[index]) |
1170 | clk_disable_unprepare(platform->clk[index]); | ||
1171 | } | ||
1168 | 1172 | ||
1169 | return 0; | 1173 | return 0; |
1170 | } | 1174 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_generic.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_generic.c index 9b544ffc..d5b82fcc 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_generic.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_generic.c | |||
@@ -96,6 +96,10 @@ err_get_clock: | |||
96 | clk_put(platform->clk[1]); | 96 | clk_put(platform->clk[1]); |
97 | if (!IS_ERR_OR_NULL(platform->clk[2])) | 97 | if (!IS_ERR_OR_NULL(platform->clk[2])) |
98 | clk_put(platform->clk[2]); | 98 | clk_put(platform->clk[2]); |
99 | |||
100 | platform->clk[0] = NULL; | ||
101 | platform->clk[1] = NULL; | ||
102 | platform->clk[2] = NULL; | ||
99 | return -ENODEV; | 103 | return -ENODEV; |
100 | } | 104 | } |
101 | 105 | ||