From f0bffa39eae2a2a7ec33649eecfbf309f1030f74 Mon Sep 17 00:00:00 2001 From: Kalpak Kawadkar Date: Tue, 29 Mar 2022 12:55:08 +0530 Subject: [PATCH] clk: qcom: debugcc-neo: Don't register debug mux if regmap is NULL If the clock controller is not present for a specific target, the regmap related to that CC will be NULL. When we register the debug mux related to that CC, the measure_only clocks of that CC while setting the parent get NULL value which lead to crash. Hence, check for the regmap before registering the mux clock. Change-Id: I30dec1c36da41c91a435de047ba7249cca84bea4 Signed-off-by: Kalpak Kawadkar --- drivers/clk/qcom/debugcc-neo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/qcom/debugcc-neo.c b/drivers/clk/qcom/debugcc-neo.c index 1aa91703f84c..4807051b34c6 100644 --- a/drivers/clk/qcom/debugcc-neo.c +++ b/drivers/clk/qcom/debugcc-neo.c @@ -1394,6 +1394,9 @@ static int clk_debug_neo_probe(struct platform_device *pdev) } for (i = 0; i < ARRAY_SIZE(mux_list); i++) { + if (!mux_list[i].mux->regmap) + continue; + ret = devm_clk_register_debug_mux(&pdev->dev, mux_list[i].mux); if (ret) { dev_err(&pdev->dev, "Unable to register mux clk %s, err:(%d)\n",