From patchwork Sat Dec 30 01:12:43 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: 10137593 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 E6224603FA for ; Sat, 30 Dec 2017 01:20:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D919E2B585 for ; Sat, 30 Dec 2017 01:20:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDC622D23A; Sat, 30 Dec 2017 01:20:25 +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 3DEC12C307 for ; Sat, 30 Dec 2017 01:20:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750993AbdL3BT1 (ORCPT ); Fri, 29 Dec 2017 20:19:27 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:45490 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961AbdL3BNS (ORCPT ); Fri, 29 Dec 2017 20:13:18 -0500 Received: by mail-wm0-f67.google.com with SMTP id 9so50432293wme.4 for ; Fri, 29 Dec 2017 17:13:17 -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=D2Jb+Ht6+M8pSg9fZx2c8bkCrTeLjA758N+NDr22qY4=; b=tgl5HJ+2NCvcmcAMpo8CiiO+sRPB5cnd3WsEM8s7bek/VgJFe/JdUvXuKsw3CBe3CC o2OFM+toQZVvmeuGaJKlrJSZfnQP1r8XKkuHwXELZsUSiYqTAVI/jjyHcHZI9wfmr8o0 sPLC89AZ454FSIcui6eRfJO+t9U1H6QG/USRg0q5RpZaa9cnC24djvFYHljHo7bfnAE3 vvr9moxbS7qQudDwFjdOUi2E0EFdLCkoOEP5g0HmKeAhBQT0gv2C1RHDdv6HMsYonVaj VZLEvNqCcLwi6tkQs7aYhbbTmhmMFsSm8Y1aKlAL+DHCNqkbqShs1mPzilcZVjqj2lmG iRAQ== 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=D2Jb+Ht6+M8pSg9fZx2c8bkCrTeLjA758N+NDr22qY4=; b=ONUVkBFBNZkfIWGj0LVa0UnrFfB3wFBG87O2Pebid3QCTpCJrOhrU9DYRDBPgafKFn an8noSqviuFsHKm5av8Qg+Fdr7rVoDQzJMaYM0NJK4/6oLYVqDiSAR4Wmx0XIRLVbDdh q+xFmlyNmiNYKEskNpn6EsTMKLQ/e+ohyQWmc4er7GiEalBKtB9ol/tCiXlAB6ZSy+k9 j3e3wqXYSW+VXdo2++fPPFgxbqPTRwm0wPX+LpwrcdrizFktxShNRkReO44RJYtLZtAF rEbMj5Mj7k6/GNjHUDh8JhcABdFF8rETmaf+jCZr66fiTiCTw8rH8jfWEyvS0GmbG/qK ZENg== X-Gm-Message-State: AKGB3mIVUdiI7H8BUlsBEJ+CV409SMM+Z4MSU354YCGCpaoTvUfqC3Zw Mglc78ypFEO+s63NwlFHolU6pQ== X-Google-Smtp-Source: ACJfBotDE2wu2pCnSX7nZdnoxHFk8PCR/Tl+VsQNMLSA5xjIkE3YXvCQMcD/idKXUCaGWq84CgwaQg== X-Received: by 10.80.194.194 with SMTP id u2mr46653767edf.260.1514596396992; Fri, 29 Dec 2017 17:13:16 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id h4sm29818268edb.16.2017.12.29.17.13.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:13:16 -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, Tony Lindgren , Russell King , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/33] clk: omap2: change omap2_round_to_table_rate return logic Date: Sat, 30 Dec 2017 01:12:43 +0000 Message-Id: <1514596392-22270-5-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: Tony Lindgren Cc: Russell King Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index e024600..ce3a33f 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -75,9 +75,9 @@ unsigned long omap2_round_to_table_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { const struct prcm_config *ptr; - long highest_rate; + unsigned long highest_rate; - highest_rate = -EINVAL; + highest_rate = 0; for (ptr = rate_table; ptr->mpu_speed; ptr++) { if (!(ptr->flags & cpu_mask))