From patchwork Thu Apr 25 10:29:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1090670 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=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=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44qYP330y6z9s3q for ; Thu, 25 Apr 2019 20:30:47 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 071A0C21E39; Thu, 25 Apr 2019 10:30:41 +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=KHOP_BIG_TO_CC 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 B5A7DC21DFD; Thu, 25 Apr 2019 10:30:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EC1F7C21DD3; Thu, 25 Apr 2019 10:30:30 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by lists.denx.de (Postfix) with ESMTPS id 10204C21D8E for ; Thu, 25 Apr 2019 10:30:27 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 44qYNf5QvHz1rbMK; Thu, 25 Apr 2019 12:30:24 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 44qYNc2J4Fz1qyC8; Thu, 25 Apr 2019 12:30:24 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 0dg3MMw82UI2; Thu, 25 Apr 2019 12:30:22 +0200 (CEST) X-Auth-Info: WD99Oc0y32TeWkl8G7Sx5InP1Xy+O/Hl8am6R2gZHxQ= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 25 Apr 2019 12:30:22 +0200 (CEST) From: Lukasz Majewski To: Stefano Babic , Fabio Estevam , Marek Vasut , Simon Glass , Tom Rini , u-boot@lists.denx.de, Jagan Teki , Peng Fan , Marcel Ziswiler , Adam Ford Date: Thu, 25 Apr 2019 12:29:44 +0200 Message-Id: <20190425102953.5348-3-lukma@denx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190425102953.5348-1-lukma@denx.de> References: <20190425102953.5348-1-lukma@denx.de> Subject: [U-Boot] [PATCH v3 02/11] cmd: Do not show frequency for clocks which .get_rate() return error 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" It may happen that some UCLASS_CLK clocks drivers work as a "managers", to call other, proper clocks. This situation is present in the iMX{6|8} clocks when supporting CONFIG_CLK (and CCF). To avoid bogus output of "clk dump" we omit clocks which return error value - allowing reusing default implementation of this command. Signed-off-by: Lukasz Majewski Reviewed-by: Simon Glass Reviewed-by: Peng Fan --- Changes in v3: None cmd/clk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/clk.c b/cmd/clk.c index fd4231589c..2ea82176aa 100644 --- a/cmd/clk.c +++ b/cmd/clk.c @@ -16,6 +16,7 @@ int __weak soc_clk_dump(void) struct udevice *dev; struct uclass *uc; struct clk clk; + ulong rate; int ret; /* Device addresses start at 1 */ @@ -37,7 +38,9 @@ int __weak soc_clk_dump(void) continue; } - printf("%-30.30s : %lu Hz\n", dev->name, clk_get_rate(&clk)); + rate = clk_get_rate(&clk); + if (!IS_ERR_VALUE(rate)) + printf("%-30.30s : %lu Hz\n", dev->name, rate); clk_free(&clk); }