From patchwork Sat Dec 30 01:12:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 10137545 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6AA316037D for ; Sat, 30 Dec 2017 01:18:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DCDA2B551 for ; Sat, 30 Dec 2017 01:18:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52B012B55D; Sat, 30 Dec 2017 01:18:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF47C2B551 for ; Sat, 30 Dec 2017 01:17:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750971AbdL3BR6 (ORCPT ); Fri, 29 Dec 2017 20:17:58 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:45513 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbdL3BNc (ORCPT ); Fri, 29 Dec 2017 20:13:32 -0500 Received: by mail-wm0-f68.google.com with SMTP id 9so50432692wme.4 for ; Fri, 29 Dec 2017 17:13:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexus-software-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xpd3kXaXigbGNzIi+9t6Q4zL9FYAiazRrWc0MtR9zps=; b=uabZOh5i7DchQFbWTwaBd1ctJ5Enrj5gIyhkZ31Dnz5afCRaug6cVWmIKX/sVfLEJ+ GP3pARAL27J+j5D5yu1dk8vl1vCR4iuMqH3w11+Dang6M27QEV5GDc7+GczZUWLOP6j5 sa2dFRaoid350BlIRXMZrIYFm5QvJ18K0S44HhMdjckPmncudgwhM5DOVP3PrnHmp1nO k7yubQpL/08QSQjKXyn2e6i4Y7KF+TK0ZPLY1b4Os92Kq5BIdS38ErPRYmzS2Y5xcoNx u6GGXE6u/Up1JsecIQoTOqtE4wtb7IMlxmlR0hF2sk8dWmsAyK3ekVEz1a9tYncpaz+h YCNA== 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:in-reply-to :references; bh=xpd3kXaXigbGNzIi+9t6Q4zL9FYAiazRrWc0MtR9zps=; b=AR/r3w8PoFPnRAhliBc4qjprlOjo7LHYZKMXjwALQ/QDKwJNegMOvjyhS3gO9ycXRV th5J8wxsV2F9O1krzBeYKUbJoASgb+2ujrBB3Axaqs5HpsuMCZnGU1aWAGkHU/wqC4We V6qIEniga89xcoUtgNFemY7Sen5q2kD2yE8PoIwLxwINROGl/Qqkr0OeAIwW0m34zmQy Zhe0QH3yLpgyVuTn94llr1hU4jLP3DiDheNnX9n6APrSSRJFKgfEtA193UDjtYuiJ1TA tsPAdmhIOXLNKDBziU0tLlrC9qPn4Mg8/q+KJk+0qvFLibqZSuVyc6/AcgfKekE2mXex AyxQ== X-Gm-Message-State: AKGB3mLeiOH9R/ZPRqEs5oeZsGhc/3V0WmdABpEkivofyG1rhIa8iG0s mEqC9tH8K1rEgGiQH5mMpByO+kq0 X-Google-Smtp-Source: ACJfBoutEnOnf5/1KPvCOtziZwpLNIVX2YNj5djqjYB/vdfFjieTGdaLPDLziAr+p5w48OI+D7PV5Q== X-Received: by 10.80.130.39 with SMTP id 36mr46649572edf.297.1514596411772; Fri, 29 Dec 2017 17:13:31 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id h4sm29818268edb.16.2017.12.29.17.13.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:13:31 -0800 (PST) From: Bryan O'Donoghue To: mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Cc: pure.logic@nexus-software.ie, Vladimir Zapolskiy , Sylvain Lemieux , Gabriel Fernandez , linux-arm-kernel@lists.infradead.org Subject: [PATCH 20/33] clk: lpc32xx: change clk_hclk_pll_round_rate() return logic Date: Sat, 30 Dec 2017 01:12:59 +0000 Message-Id: <1514596392-22270-21-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514596392-22270-1-git-send-email-pure.logic@nexus-software.ie> References: <1514596392-22270-1-git-send-email-pure.logic@nexus-software.ie> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch updates the round_rate() logic here to return zero instead of a negative number on error. In conjunction with higher-level changes associated with acting on the return value of clk_ops->round_rate() it is then possible to have clk_ops->round_rate() return values from 1 Hz to ULONG_MAX Hz instead of the current limitation of 1 Hz to LONG_MAX Hz. Signed-off-by: Bryan O'Donoghue Cc: Michael Turquette Cc: Stephen Boyd Cc: Vladimir Zapolskiy Cc: Sylvain Lemieux Cc: Gabriel Fernandez Cc: linux-clk@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/clk/nxp/clk-lpc32xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/nxp/clk-lpc32xx.c b/drivers/clk/nxp/clk-lpc32xx.c index 81ab57d..76c17f4 100644 --- a/drivers/clk/nxp/clk-lpc32xx.c +++ b/drivers/clk/nxp/clk-lpc32xx.c @@ -595,7 +595,7 @@ static unsigned long clk_hclk_pll_round_rate(struct clk_hw *hw, pr_debug("%s: %lu/%lu\n", clk_hw_get_name(hw), *parent_rate, rate); if (rate > 266500000) - return -EINVAL; + return 0; /* Have to check all 20 possibilities to find the minimal M */ for (p_i = 4; p_i >= 0; p_i--) { @@ -622,7 +622,7 @@ static unsigned long clk_hclk_pll_round_rate(struct clk_hw *hw, if (d == (u64)rate << 6) { pr_err("%s: %lu: no valid PLL parameters are found\n", clk_hw_get_name(hw), rate); - return -EINVAL; + return 0; } clk->m_div = m;