From 900f63393d80cc1978c5758a368cf1edb3d267ae Mon Sep 17 00:00:00 2001 From: Alex Van Brunt Date: Mon, 11 May 2015 09:52:09 -0700 Subject: gpu: nvgpu: don't reset clk that doesn't exist If the clock is null, calling the reset function will crash the kernel. So, don't call the reset function. Change-Id: I37ef25c8dca67bec8bf6654eb6e275b866bdae53 Signed-off-by: Alex Van Brunt Reviewed-on: http://git-master/r/742361 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gk20a/gk20a.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index f6c9f901..eb6774da 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1311,10 +1311,12 @@ static int gk20a_secure_page_alloc(struct platform_device *pdev) int err = 0; if (platform->secure_page_alloc) { - tegra_periph_reset_assert(platform->clk[0]); + if (platform->num_clks > 0) + tegra_periph_reset_assert(platform->clk[0]); udelay(10); err = platform->secure_page_alloc(pdev); - tegra_periph_reset_deassert(platform->clk[0]); + if (platform->num_clks > 0) + tegra_periph_reset_deassert(platform->clk[0]); } if (!err) -- cgit v1.2.2