From 0092e08d5ce8dfe77b6ac1ecd48cb4a6229496df Mon Sep 17 00:00:00 2001 From: Nicholas Troast Date: Thu, 3 Aug 2017 13:52:33 -0700 Subject: [PATCH] power: pmic-voter: make debug status more parsable The status debug property lists all of the voters, their enable and value status, and the effective result. Currently the status is presented on multiple lines which is difficult to parse. Change the format to be more parsable. Print each voter in the following format: VOTABLE: CLIENT: en=1 v=1000 Print a single summary line at the end in the following format: VOTABLE: effective=EFFECTIVE_CLIENT type=VOTABLE_TYPE v=1000 Change-Id: I0671cdd8e0911450bafe4869cb49cc48bd622a81 Signed-off-by: Nicholas Troast --- drivers/power/supply/qcom/pmic-voter.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/power/supply/qcom/pmic-voter.c b/drivers/power/supply/qcom/pmic-voter.c index b99558ed2100..0deacdeb0171 100644 --- a/drivers/power/supply/qcom/pmic-voter.c +++ b/drivers/power/supply/qcom/pmic-voter.c @@ -519,11 +519,10 @@ static int show_votable_clients(struct seq_file *m, void *data) lock_votable(votable); - seq_printf(m, "Votable %s:\n", votable->name); - seq_puts(m, "clients:\n"); for (i = 0; i < votable->num_clients; i++) { if (votable->client_strs[i]) { - seq_printf(m, "%-15s:\t\ten=%d\t\tv=%d\n", + seq_printf(m, "%s: %s:\t\t\ten=%d v=%d\n", + votable->name, votable->client_strs[i], votable->votes[i].enabled, votable->votes[i].value); @@ -542,11 +541,11 @@ static int show_votable_clients(struct seq_file *m, void *data) break; } - seq_printf(m, "type: %s\n", type_str); - seq_puts(m, "Effective:\n"); effective_client_str = get_effective_client_locked(votable); - seq_printf(m, "%-15s:\t\tv=%d\n", + seq_printf(m, "%s: effective=%s type=%s v=%d\n", + votable->name, effective_client_str ? effective_client_str : "none", + type_str, get_effective_result_locked(votable)); unlock_votable(votable);