diff --git a/debugcc.c b/debugcc.c index e3771e6..88b947f 100644 --- a/debugcc.c +++ b/debugcc.c @@ -201,9 +201,8 @@ unsigned long measure_mccc(const struct measure_clk *clk) static void measure(const struct measure_clk *clk) { unsigned long clk_rate; - struct debug_mux *gcc = clk->primary; - if (!leaf_enabled(gcc, clk->leaf)) { + if (!leaf_enabled(clk->primary, clk->leaf)) { printf("%50s: skipping\n", clk->name); return; } @@ -211,14 +210,16 @@ static void measure(const struct measure_clk *clk) if (clk->leaf) mux_prepare_enable(clk->leaf, clk->leaf_mux); - mux_prepare_enable(clk->primary, clk->mux); + if (clk->primary) + mux_prepare_enable(clk->primary, clk->mux); if (clk->leaf && clk->leaf->measure) clk_rate = clk->leaf->measure(clk); else clk_rate = measure_default(clk); - mux_disable(clk->primary); + if (clk->primary) + mux_disable(clk->primary); if (clk->leaf) mux_disable(clk->leaf); diff --git a/sc8280xp.c b/sc8280xp.c index 482d6e4..eabf328 100644 --- a/sc8280xp.c +++ b/sc8280xp.c @@ -426,7 +426,7 @@ static struct measure_clk sc8280xp_clocks[] = { { "disp1_cc_mdss_vsync_clk", &gcc, 0x82, &disp1_cc, 0x17 }, { "disp1_cc_sleep_clk", &gcc, 0x82, &disp1_cc, 0x46 }, { "disp1_cc_xo_clk", &gcc, 0x82, &disp1_cc, 0x45 }, - { "measure_only_mccc_clk", &gcc, 0xfeedbeef, &mc_cc, 0x50 }, + { "measure_only_mccc_clk", NULL, 0, &mc_cc, 0x50 }, {} };