Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CC68C636D6 for ; Mon, 20 Feb 2023 06:01:19 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5715E85870; Mon, 20 Feb 2023 07:01:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="c5vgdhz9"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="IatuA2rV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 34E32857B1; Mon, 20 Feb 2023 06:59:58 +0100 (CET) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A8FB685831 for ; Mon, 20 Feb 2023 06:59:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 8891B3200C9C; Mon, 20 Feb 2023 00:59:47 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 20 Feb 2023 00:59:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1676872787; x=1676959187; bh=fa ud5H1uc7trTti7B1RG5hKJO9LR30D7I/HN31Sn/fA=; b=c5vgdhz9DKcgmRa4eE RPmiTr8/EkGUnUT/ukFx1P9WozuuTFE38C2vNi7xlFJFKv8rwTk5JbbLZ36yDyLM UiFPC1bxPvdhHdeu+YWt805wnuIvonAk7hzEPux/POmJi+W2XEOpHyD6f6j6pqWi WB9MAw6m5WtkAMg8lcBE47CEMo/xR2rCbEKoWE2uSproZ/Hiz+W3ZdTP4HZekjT7 4vp+qGDwfgHFMf3zb86x1Wyxw5tz2vEP8wgdGBt6nYnRIqq9WsxYR2DH6JOPm7U6 SAkCL4gc7aFDStLWRJzTp18CiOVnRXVtg+kXrYCjUSh62JHzr+5fzA4OQREWQJyB P1eQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1676872787; x=1676959187; bh=faud5H1uc7trT ti7B1RG5hKJO9LR30D7I/HN31Sn/fA=; b=IatuA2rVjV2LmU49VvW5Q2JwfkC/v lVffVb3cMl76hH+clmVkXyP4pADZWDZqqb86WJH9zi/v8hrIvrB7aZIVH4Hk3JAz dd3JIctvgG2t2dbyMzXBFiJ/Jl+u5LbLsYHAllDpBIqrl/hH1S1c39Gg+Qxt251C 3XdKb/+RyNO0NPDzCqNkNK3nypJLmyOPDtRrkaOxaRNsrRMtez4ILq3vFRkO9Yvx Eg8G2qnQZJ6AG7N/rhw9OBg4lSLBNncg379MDnfTn8yyenJr1Pr5zNZSPXuOhPs5 92S3TF8TakiRsaD4LJScSZa1OGARq3Qtw5reoR/LM5jcMQ0LEgwgqgbFA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejgedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Feb 2023 00:59:46 -0500 (EST) From: Samuel Holland To: Lukasz Majewski , Sean Anderson , Simon Glass Cc: Samuel Holland , Dario Binacchi , Jean-Jacques Hiblot , Michal Suchanek , Neil Armstrong , Peng Fan , u-boot@lists.denx.de Subject: [PATCH 2/6] clk: Fix error handling in clk_get_rate() Date: Sun, 19 Feb 2023 23:59:35 -0600 Message-Id: <20230220055940.41890-3-samuel@sholland.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230220055940.41890-1-samuel@sholland.org> References: <20230220055940.41890-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean log_ret() cannot work with unsigned values, and the assignment to 'ret' incorrectly truncates the rate from long to int. Fixes: 5c5992cb90cf ("clk: Add debugging for return values") Signed-off-by: Samuel Holland --- drivers/clk/clk-uclass.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index dc3e9d6a261..78299dbceb2 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -471,7 +471,6 @@ void clk_free(struct clk *clk) ulong clk_get_rate(struct clk *clk) { const struct clk_ops *ops; - int ret; debug("%s(clk=%p)\n", __func__, clk); if (!clk_valid(clk)) @@ -481,11 +480,7 @@ ulong clk_get_rate(struct clk *clk) if (!ops->get_rate) return -ENOSYS; - ret = ops->get_rate(clk); - if (ret) - return log_ret(ret); - - return 0; + return ops->get_rate(clk); } struct clk *clk_get_parent(struct clk *clk) -- 2.39.2