From patchwork Thu Dec 6 01:42:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1008589 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="oc6YXHzY"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 439Lv15Qg8z9s1c for ; Thu, 6 Dec 2018 14:39:25 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2D660C2231D; Thu, 6 Dec 2018 03:39:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C0B40C222B7; Thu, 6 Dec 2018 01:45:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4A0C1C220E6; Thu, 6 Dec 2018 01:45:10 +0000 (UTC) Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by lists.denx.de (Postfix) with ESMTPS id 95493C2209F for ; Thu, 6 Dec 2018 01:42:55 +0000 (UTC) Received: by mail-io1-f69.google.com with SMTP id b21so9461279ioj.8 for ; Wed, 05 Dec 2018 17:42:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:message-id:mime-version:subject:from:to:cc; bh=ZpGeNUX6u5PS4HUZsFFX5twVMABARUGXibJcKTffxlg=; b=oc6YXHzYer7/2ldy5rUfHlJSt250OiPiNXk7/qiKDq0kqUhi4rRQdQUiLiEch8rAuY BAOVj3DYuWBchtAMa0fxLlWe7r6iGotWazmpaVENGJAZmJA8MR03y9yLC0rYF2SosHS6 jWKH6OdWz2sCarxYaDfSrDbnH50Ql6rxpSPr0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=ZpGeNUX6u5PS4HUZsFFX5twVMABARUGXibJcKTffxlg=; b=a9cFV8tsXdkBBmctp9dDvnSiyoNVi8vQasDKbXYo5U4Io56gUOXw/oNhUi2i5XqNFr ea44T2K4ma1XRTBGFFzoUPtQXdCs0+lC48hQKCsW2wRniuRFK9EzUtMzNc1VSXA+VNTL rxYcECNlI2hn2Mx7jboCbYff1pY3uNozvyGCngQBmmcCTxBuVj3VpHCwbf5Mb8uXxPRR kROhRVKnoadOGOiJFnx/lVG8msVVZ24J7JN4p7Zp3T8lhXy3Vljnqm/QQXcAHnrlqjg3 478YA4In67rm88Uwln4AwsGsWTjihC1zGrKxcI2b9VBKdWUuSyUYnR+jJJMKC+KnDzqJ LcVw== X-Gm-Message-State: AA+aEWalUq4tiDY7gB6iUntIO8UMmGdWEdtiHXS+n8iAgsz5UzBZ+/sw BD+xc/YD+JQeSQ8oaOoTqxoosh82VZC3cQVb X-Google-Smtp-Source: AFSGD/WgwfhGycNDYF7Ipi+6Qr1pTtGgTtf7rAPoOrd+NQDLjhnmnv1DblNClIFS1rofEI4mnnDH3Cx/2wDpVT6q X-Received: by 2002:a24:41cb:: with SMTP id b72mr14760637itd.4.1544060574454; Wed, 05 Dec 2018 17:42:54 -0800 (PST) Date: Wed, 5 Dec 2018 18:42:52 -0700 Message-Id: <20181206014252.133273-1-sjg@chromium.org> Mime-Version: 1.0 X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog From: Simon Glass To: U-Boot Mailing List Subject: [U-Boot] [PATCH] dm: Tidy up 'dm tree' output when there are many devices X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present the 'Index' column assumes there is only one digit. But on some devices (e.g. snow) there are a lot of regulators and GPIO banks. Adjust the output to allow for two digits without messing up the display. Also capatalise the heading to match. Fixes: 5197dafc42 (dm: core: Widen the dump tree to show more of the driver's name.) Signed-off-by: Simon Glass Reviewed-by: Liviu Dudau Reviewed-by: Liviu Dudau --- drivers/core/dump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/core/dump.c b/drivers/core/dump.c index 04217cbde87..8fbfd93fb5e 100644 --- a/drivers/core/dump.c +++ b/drivers/core/dump.c @@ -16,7 +16,7 @@ static void show_devices(struct udevice *dev, int depth, int last_flag) struct udevice *child; /* print the first 20 characters to not break the tree-format. */ - printf(" %-10.10s %d [ %c ] %-20.20s ", dev->uclass->uc_drv->name, + printf(" %-10.10s %2d [ %c ] %-20.20s ", dev->uclass->uc_drv->name, dev_get_uclass_index(dev, NULL), dev->flags & DM_FLAG_ACTIVATED ? '+' : ' ', dev->driver->name); @@ -49,7 +49,7 @@ void dm_dump_all(void) root = dm_root(); if (root) { - printf(" Class index Probed Driver Name\n"); + printf(" Class Index Probed Driver Name\n"); printf("-----------------------------------------------------------\n"); show_devices(root, -1, 0); }