From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 604C0C48BD1 for ; Fri, 11 Jun 2021 08:47:37 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D15D960C40 for ; Fri, 11 Jun 2021 08:47:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D15D960C40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3BC3E80ECC; Fri, 11 Jun 2021 10:46:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="TbzLmHGK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8D11F8031D; Fri, 11 Jun 2021 10:45:54 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3B93A80092 for ; Fri, 11 Jun 2021 10:45:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kristo@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id EC6F4613C8; Fri, 11 Jun 2021 08:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623401149; bh=ADwM3bA15JtLhfqAaCe3zkDI7eLMaEIkSdv7zwk49GE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TbzLmHGKqa2B4n0wZy2cSS06TR/bZVcO8z/D9kBC4rFSeNaV4UCnHhfXdt0Qj0zzr mTvbttN6/lFQ5iYaCOUSvMST+Ldx3bol94/wzi7oKWaavkt1tky3s8sjWiOvkNNGCy Gurwvv2xXwDRlEfsHRXuHyRtY+Y1LkZslLJhvgTPGRh4i/eL0fv3NQ8C/QcUys16Sn 3IRNlK0/El8priCXNS6f49CK7IJ0zm83+ZUXtY1MdKjxInR62epjTLGFNHjnDnNEw/ imBsA0ZV8fRg2RiXW7Go9YwC1fVpyeHaTkTeXwoTnBlwpL9gRbYg3VUeU6y1g1MrHt NtgCVBWycwewA== From: Tero Kristo To: lokeshvutla@ti.com, trini@konsulko.com, u-boot@lists.denx.de Subject: [PATCHv6 09/26] clk: sci-clk: fix return value of set_rate Date: Fri, 11 Jun 2021 11:45:10 +0300 Message-Id: <20210611084527.7048-10-kristo@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210611084527.7048-1-kristo@kernel.org> References: <20210611084527.7048-1-kristo@kernel.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean From: Tero Kristo Set rate should return the new clock rate on success, and negative error value on failure. Fix this, as currently set_rate returns 0 on success. Signed-off-by: Tero Kristo Signed-off-by: Tero Kristo --- drivers/clk/ti/clk-sci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/ti/clk-sci.c b/drivers/clk/ti/clk-sci.c index 6f0fdaa111..acb9eadf03 100644 --- a/drivers/clk/ti/clk-sci.c +++ b/drivers/clk/ti/clk-sci.c @@ -111,10 +111,12 @@ static ulong ti_sci_clk_set_rate(struct clk *clk, ulong rate) #endif ret = cops->set_freq(sci, clk->id, clk->data, 0, rate, ULONG_MAX); - if (ret) + if (ret) { dev_err(clk->dev, "%s: set_freq failed (%d)\n", __func__, ret); + return ret; + } - return ret; + return rate; } static int ti_sci_clk_set_parent(struct clk *clk, struct clk *parent) -- 2.17.1