Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e2d93e1 authored by Vivek Aknurwar's avatar Vivek Aknurwar
Browse files

clk: qcom: clk-debug: List regs only if respective clk is qcom-regmap clk



List register ops is provider supported hence can not be
called on clk framework clks. For example: xo-board,sleep-clk
are fixed clock.

List/print only those clocks who are qcom-regmap clks.
Cast member structure only if clk_hw is valid clk_regmap clk.

Change-Id: Id66856f45166a32e37ea7e477f80360ab020ab25
Signed-off-by: default avatarVivek Aknurwar <viveka@codeaurora.org>
parent faa9650c
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2016, 2019, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2016, 2019-2020, The Linux Foundation. All rights reserved. */

#include <linux/clk.h>
#include <linux/export.h>
@@ -512,18 +512,20 @@ static const struct file_operations list_rates_fops = {

static void clk_debug_print_hw(struct clk_hw *hw, struct seq_file *f)
{
	struct clk_regmap *rclk = to_clk_regmap(hw);
	struct clk_regmap *rclk;

	if (IS_ERR_OR_NULL(hw))
		return;

	clk_debug_print_hw(clk_hw_get_parent(hw), f);

	seq_printf(f, "%s\n", clk_hw_get_name(hw));

	if (clk_is_regmap_clk(hw)) {
		rclk = to_clk_regmap(hw);
		if (rclk->ops && rclk->ops->list_registers)
			rclk->ops->list_registers(f, hw);
	}
}

static int print_hw_show(struct seq_file *m, void *unused)
{