From patchwork Thu Jun 16 20:29:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 1999 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 19D7F23E54 for ; Thu, 16 Jun 2011 20:31:51 +0000 (UTC) Received: from mail-vw0-f50.google.com (mail-vw0-f50.google.com [209.85.212.50]) by fiordland.canonical.com (Postfix) with ESMTP id DD0B1A188FF for ; Thu, 16 Jun 2011 20:31:50 +0000 (UTC) Received: by vws14 with SMTP id 14so1756184vws.37 for ; Thu, 16 Jun 2011 13:31:50 -0700 (PDT) Received: by 10.52.168.65 with SMTP id zu1mr1893541vdb.207.1308256310379; Thu, 16 Jun 2011 13:31:50 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs211215vdc; Thu, 16 Jun 2011 13:31:50 -0700 (PDT) Received: by 10.227.196.80 with SMTP id ef16mr1345372wbb.27.1308256306455; Thu, 16 Jun 2011 13:31:46 -0700 (PDT) Received: from smtp.smtpout.orange.fr (smtp08.smtpout.orange.fr [80.12.242.130]) by mx.google.com with ESMTP id fq6si1371853wbb.15.2011.06.16.13.31.45; Thu, 16 Jun 2011 13:31:46 -0700 (PDT) Received-SPF: neutral (google.com: 80.12.242.130 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=80.12.242.130; Authentication-Results: mx.google.com; spf=neutral (google.com: 80.12.242.130 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: from monster.dhcp.lxc ([92.134.76.78]) by mwinf5d16 with ME id wkXf1g0031hMfSL03kXlJu; Thu, 16 Jun 2011 22:31:45 +0200 From: Daniel Lezcano To: patches@linaro.org Subject: [PATCH 15/28] Remove old clock tree dump code Date: Thu, 16 Jun 2011 22:29:44 +0200 Message-Id: <1308256197-29155-15-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1308256197-29155-1-git-send-email-daniel.lezcano@linaro.org> References: <1308256197-29155-1-git-send-email-daniel.lezcano@linaro.org> It is replaced by the tree code. Signed-off-by: Daniel Lezcano --- clocks.c | 56 +++----------------------------------------------------- 1 files changed, 3 insertions(+), 53 deletions(-) diff --git a/clocks.c b/clocks.c index 5bb04a4..5f494cd 100644 --- a/clocks.c +++ b/clocks.c @@ -646,59 +646,9 @@ static int dump_clock_cb(struct tree *t, void *data) return 0; } -void dump_clock_info(struct clock_info *clk, int level, int bmp) +int dump_clock_info(void) { - int i, j; - - if (!clk) - return; - - for (i = 1, j = 0; i < level; i++, j = (i - 1)) { - if (i == (level - 1)) { - if (clk->last_child) - printf("`-- "); - else - printf("|-- "); - } else { - if ((1<name); - else { - char *unit = "Hz"; - double drate = (double)clk->rate; - - if (drate > 1000 && drate < 1000000) { - unit = "KHz"; - drate /= 1000; - } - if (drate > 1000000) { - unit = "MHz"; - drate /= 1000000; - } - printf("%s (flags:0x%x,usecount:%d,rate:%5.2f %s)\n", - clk->name, clk->flags, clk->usecount, drate, unit); - } - if (clk->children) { - int tbmp = bmp; - int xbmp = -1; - - if (clk->last_child) { - xbmp ^= 1 << (level - 2); - - xbmp = tbmp & xbmp; - } else - xbmp = bmp; - for (i = 0; i < clk->num_children; i++) { - tbmp = xbmp | (1 << level); - dump_clock_info(clk->children[i], level + 1, tbmp); - } - } + return tree_for_each(clock_tree, dump_clock_cb, NULL); } void read_and_dump_clock_info(int verbose) @@ -707,6 +657,6 @@ void read_and_dump_clock_info(int verbose) printf("\nClock Tree :\n"); printf("**********\n"); read_clock_info(clk_dir_path); - dump_clock_info(clocks_info, 1, 1); + dump_clock_info(); printf("\n\n"); }