From patchwork Fri Mar 20 05:53:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1258655 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=gDSU8i4u; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48kCcw3Z3wz9sRN for ; Fri, 20 Mar 2020 16:53:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 29BEF81286; Fri, 20 Mar 2020 06:53:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gDSU8i4u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9A527812B1; Fri, 20 Mar 2020 06:53:28 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BD524800DF for ; Fri, 20 Mar 2020 06:53:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qv1-xf42.google.com with SMTP id o18so2396415qvf.1 for ; Thu, 19 Mar 2020 22:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wzkU6Cy8XhjKBG7jUpScZDJb/xcdEy4QMEdtsnJmUB8=; b=gDSU8i4ua9a0MMpXPS7zOMIJgZoApqur5XrMXU1FDvVngjm8R5t+/isO+UikuYKms9 fxQ911JiG2S53BWxz/n/sAkQuizaz2aSvEGJylT0bL4CyO2SJd7r9xH9ebM+MvZG/n04 hyFJ5gA0DRo/0iXkm0N1O4QUeIXrCjvF2i4aW6pf9UOuBliJX7bdsjfBszhXpLZZ7LjV U7IE0F6pqWQnHTDLtq4wXaB3PlAOW/hLUDlsD8z+A6AZs9bln79EBL0kV0QGf1qDB15S iklPXVpe3DTq9wuq1zjawZ3cXc52LzAeZ4zyUOe4U2igH2s/bX1Rbzh1rTdbnDI95xA7 uaRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wzkU6Cy8XhjKBG7jUpScZDJb/xcdEy4QMEdtsnJmUB8=; b=OxHI8kHGHE+INjk2Nj5zZUcFuAlMMpsgAqwNB3jre08AsHm2C1HlVrg8qJADroi90w nRULh3Elb5MfK4anYAtWy9h6ulPkK6AapEwJ0ccB7v3/WeDNGDoFQVCi5HwJHT3GXmfj BH09q3bDkGbF7s3ZSDa4XH8EsmksED0wfU2veCFTXKUgp2if0jg1sAAsYOBg0v7k+iSe rvx2N2pASuo0ZeRpPxZSiCQ4rrG46XXbQEXaPDcU0Es/HU9opbSeG0a0F5YeupQgYqEp syOCE/64Guq2iRVXeoDWH0S7VkcIVfnDqStklCH+GLruaBt93fe4CDiub7jsQgiDil8o RaIA== X-Gm-Message-State: ANhLgQ2FKu0swbPa/iYDlazn1p3SkOL97Nmt03rsGiCuilqXPMEmmELg SkoKFgQxM5ge+1SzWFRuCs8O+VkP X-Google-Smtp-Source: ADFU+vtbE3aQakSz+Djai2ihBvyX2q75YItDxIaSQA3Hx8AmbgVhxbn6z7bTwr8TPKbPCgq953lN1A== X-Received: by 2002:a05:6214:3c9:: with SMTP id ce9mr6625083qvb.212.1584683604088; Thu, 19 Mar 2020 22:53:24 -0700 (PDT) Received: from godwin.fios-router.home (pool-71-163-33-7.washdc.fios.verizon.net. [71.163.33.7]) by smtp.gmail.com with ESMTPSA id p23sm3257602qkm.39.2020.03.19.22.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 22:53:23 -0700 (PDT) From: Sean Anderson To: u-boot@lists.denx.de Cc: Lukasz Majewski , Sean Anderson Subject: [PATCH] clk: Add more information to debug messages Date: Fri, 20 Mar 2020 01:53:16 -0400 Message-Id: <20200320055316.746438-1-seanga2@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Some of the debug messages in the clock subsystem can be made more informative by adding the clock name or adding the explicit error. Signed-off-by: Sean Anderson Acked-by: Lukasz Majewski Reviewed-by: Simon Glass --- drivers/clk/clk-uclass.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 71878474eb..d44df05680 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -237,8 +237,8 @@ static int clk_set_default_parents(struct udevice *dev, int stage) continue; if (ret < 0) { - debug("%s: failed to reparent clock %d for %s\n", - __func__, index, dev_read_name(dev)); + debug("%s: failed to reparent clock %d for %s (err = %d)\n", + __func__, index, dev_read_name(dev), ret); return ret; } } @@ -295,8 +295,8 @@ static int clk_set_default_rates(struct udevice *dev, int stage) ret = clk_set_rate(&clk, rates[index]); if (ret < 0) { - debug("%s: failed to set rate on clock index %d (%ld) for %s\n", - __func__, index, clk.id, dev_read_name(dev)); + debug("%s: failed to set rate on clock index %d (%ld) for %s (err = %d)\n", + __func__, index, clk.id, dev_read_name(dev), ret); break; } } @@ -436,7 +436,7 @@ ulong clk_get_rate(struct clk *clk) { const struct clk_ops *ops; - debug("%s(clk=%p)\n", __func__, clk); + debug("%s(clk=%p \"%s\")\n", __func__, clk, clk->dev->name); if (!clk_valid(clk)) return 0; ops = clk_dev_ops(clk->dev); @@ -452,7 +452,7 @@ struct clk *clk_get_parent(struct clk *clk) struct udevice *pdev; struct clk *pclk; - debug("%s(clk=%p)\n", __func__, clk); + debug("%s(clk=%p) \"%s\"\n", __func__, clk, clk->dev->name); if (!clk_valid(clk)) return NULL; @@ -469,7 +469,7 @@ long long clk_get_parent_rate(struct clk *clk) const struct clk_ops *ops; struct clk *pclk; - debug("%s(clk=%p)\n", __func__, clk); + debug("%s(clk=%p \"%s\")\n", __func__, clk, clk->dev->name); if (!clk_valid(clk)) return 0; @@ -492,7 +492,8 @@ ulong clk_set_rate(struct clk *clk, ulong rate) { const struct clk_ops *ops; - debug("%s(clk=%p, rate=%lu)\n", __func__, clk, rate); + debug("%s(clk=%p \"%s\", rate=%lu)\n", __func__, clk, clk->dev->name, + rate); if (!clk_valid(clk)) return 0; ops = clk_dev_ops(clk->dev); @@ -507,7 +508,8 @@ int clk_set_parent(struct clk *clk, struct clk *parent) { const struct clk_ops *ops; - debug("%s(clk=%p, parent=%p)\n", __func__, clk, parent); + debug("%s(clk=%p \"%s\", parent=%p \"%s\")\n", __func__, clk, + clk->dev->name, parent, parent->dev->name); if (!clk_valid(clk)) return 0; ops = clk_dev_ops(clk->dev); @@ -524,7 +526,7 @@ int clk_enable(struct clk *clk) struct clk *clkp = NULL; int ret; - debug("%s(clk=%p)\n", __func__, clk); + debug("%s(clk=%p \"%s\")\n", __func__, clk, clk->dev->name); if (!clk_valid(clk)) return 0; ops = clk_dev_ops(clk->dev); @@ -584,7 +586,7 @@ int clk_disable(struct clk *clk) struct clk *clkp = NULL; int ret; - debug("%s(clk=%p)\n", __func__, clk); + debug("%s(clk=%p) \"%s\"\n", __func__, clk, clk->dev->name); if (!clk_valid(clk)) return 0; ops = clk_dev_ops(clk->dev);