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: 10137531 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 79A636037D for ; Sat, 30 Dec 2017 01:17:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AC482B551 for ; Sat, 30 Dec 2017 01:17:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F9B12B55D; Sat, 30 Dec 2017 01:17:34 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B99A32B551 for ; Sat, 30 Dec 2017 01:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=18fic4fLwoiI8KUithvImLsqNTEXozaDJ9VXuLtnJ9Y=; b=JD6wALj8WJmZvjVU6IOc3FdZdz 2ijUKaHX/k1QIgwm5gTP+nXsbw5gXpUyRHEUxpli5gYdE6D0JaZwFJYN39NQj5Qkm14LzTa1piUAq XGlvY72xWjnxAtq6YYpA+S1XQph73fLgxYUWDMb42SqmpbMckI938z40Wuo7sY3mIj82Ahnxy8Vu7 9mu3YrPEEZi0KXQCDLGLibajON8nrVKSZr4jIen0lar37orpTeeeKXlpZ3Vnp9ECtSJhcCbfYIoS8 M5/S355HUIVB6YF39pdaVcsj/8pAT8fCglYgvSY0elw8J9nUSCLPQg8GTX03znzJx0ltKcJy5YSXc tr/rAhVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eV5mD-0005FF-Jw; Sat, 30 Dec 2017 01:17:29 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eV5iZ-0001Lj-5l for linux-arm-kernel@lists.infradead.org; Sat, 30 Dec 2017 01:14:34 +0000 Received: by mail-wm0-x244.google.com with SMTP id r78so50737883wme.5 for ; Fri, 29 Dec 2017 17:13:33 -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=FADPeIuISDIn42VNmXiOsgjvYFl1j2gaHx0otF5g+cC4oS7/f3Eqz5Gdqb1m1Iw5bX 1i6I8B5pYyxK7Vn1B1TPhTO27XygLzn+//F1qonOqBJWjxjX4YMHUBa3EyNAhbRBgONc CnlHWciDlPIHEs4MS+u74vEtFE6J+JUNxtH3LWJ+vkx8IvHVESd5CrsBDZ9YNa+oIVLu Q103fevPVNzP5pP8eZnEuzhkakm7qRFi7auEN+nCsQfW24M5iT9fs6btm3pt9W70uGBx Uza8wTix1MhmM8NHsGAU/EYQ1v75cIWDQ2hyGvLNUxBiwG5PLzWW5s7PmhdizKPkLjHQ OuAg== X-Gm-Message-State: AKGB3mIxNa42YSEeE+l+hjUHvoh+cpgWBr2wSsMjuXbbt/d32NRp3cZg S2Y+K4WVc02YG5ekU11JtVNO4w== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171229_171343_614357_A243B3BB X-CRM114-Status: GOOD ( 11.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pure.logic@nexus-software.ie, Sylvain Lemieux , Gabriel Fernandez , linux-arm-kernel@lists.infradead.org, Vladimir Zapolskiy MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;