From e1be59fc1a959a917749ecf24834acdc6e2d70e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Fri, 23 Oct 2015 12:46:03 +0200 Subject: [PATCH] video: ipu: initialize g_ipu_clk, g_ldb_clk statically When the FB driver has not been initialized, booting Linux will hang the system when ipuv3_fb_shutdown() is called from arch_preboot_os() because clk_enable(g_ipu_clk) is a NOP with g_ipu_clk == NULL. There is no need to initialize these variables at runtime, so use static initialization to prevent this problem. --- drivers/video/ipu_common.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c index ecfec7755a..355c697ef4 100644 --- a/drivers/video/ipu_common.c +++ b/drivers/video/ipu_common.c @@ -125,8 +125,8 @@ static struct clk ldb_clk = { }; /* Globals */ -struct clk *g_ipu_clk; -struct clk *g_ldb_clk; +struct clk *g_ipu_clk = &ipu_clk; +struct clk *g_ldb_clk = &ldb_clk; struct clk *g_di_clk[2]; struct clk *g_pixel_clk[2]; unsigned char g_dc_di_assignment[10]; @@ -409,10 +409,7 @@ int ipu_probe(int di, ipu_di_clk_parent_t di_clk_parent, int di_clk_val) g_di_clk[1] = &di_clk[1]; g_di_clk[di]->rate = di_clk_val; - g_ipu_clk = &ipu_clk; debug("ipu_clk = %u\n", clk_get_rate(g_ipu_clk)); - - g_ldb_clk = &ldb_clk; debug("ldb_clk = %u\n", clk_get_rate(g_ldb_clk)); ret = clk_enable(g_ipu_clk); -- 2.39.2