diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 10 |
1 files changed, 7 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 | } |