From patchwork Sat Dec 30 01:12:50 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: 10137539 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 607D96037D for ; Sat, 30 Dec 2017 01:17:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 538F92B551 for ; Sat, 30 Dec 2017 01:17:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 484382B55D; Sat, 30 Dec 2017 01:17:55 +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 B9C642B551 for ; Sat, 30 Dec 2017 01:17:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751167AbdL3BNe (ORCPT ); Fri, 29 Dec 2017 20:13:34 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34974 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbdL3BNZ (ORCPT ); Fri, 29 Dec 2017 20:13:25 -0500 Received: by mail-wm0-f66.google.com with SMTP id a79so11266414wma.0 for ; Fri, 29 Dec 2017 17:13:24 -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=rJSOxvQ+UuDiwk1jYvhD73JGw3GfTH2sBrWtud0TcCc=; b=Fl+v0KNUWH/uXrRiI+ZiiQ3P5+i0rmi2yBdpYj5jfH6e5/umM4HpIZf0AKTGxJRUYt jvInYe+PlSZ01FLPHm1xwsbkoA5CYHl4KGt8NxK2nVxUUnCS0o9XpbGKjt4Rzfxldt8z O4z3hNA7Kbi+GOk9+Pq+frgXCzgLhDCnWbE94XJlVw5n0pvMnUOLD5PMxQFx29Mc9eUQ zIuURZ+WsUQxXI8T1HKfAUJ1LQrfxr/ISNb5QOOrzFLtZ2MdWLkT5qLoRUOM8l/dot1c 2753BKeyPks/77XCjP4nhhyjOGA9JS2Goj0Pv60dsvX/jXRomR+kvt86lphI7uYvi2+O 8sAQ== 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=rJSOxvQ+UuDiwk1jYvhD73JGw3GfTH2sBrWtud0TcCc=; b=ZrofrsXxLENUGI6yLI58TGHYUOztmtkQ+nfubEGP0Qh2OVK7JQlL3hObzV1G+I7IEw k5o9qhiDeGSnihrHnKaHy6+i9bCT92TTYs+6jMwoYvi00IM9G3LbY63a5uBMCtnS8mIS gYBXjU3OTwAG6LVplqIJAzkQVw9kF/toxnNN9Lyz+34KD63qQuCwp0zQKEu587uAs6y2 7ryH49eNDbJnBq8YUUpzi6hJjIsIOtxhngbDqUBFt4kZkW+9mjL2MGhjosJoDXoIRv6f YxrmoNQwB4g5UPmg4V6gkv0UfrRKcScD00oS4xWasn+ko+TvvkwYTdvRpUQIWSahaG5x hG2w== X-Gm-Message-State: AKGB3mI+2laPJ8FiD4Ytlip01BfXFsOJ+jDBJ9+yNhRZlE7q157R3CMI Xce1bViQoo8cURDhtu+NdfuJPw== X-Google-Smtp-Source: ACJfBovkJH5hBg/m1JEZojfce1e19O9j2ENwYDYPSdGj6OVjuyB1qjvgRCcbxXWgffsQUtcwajM1kQ== X-Received: by 10.80.241.72 with SMTP id z8mr47877934edl.35.1514596403864; Fri, 29 Dec 2017 17:13:23 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id h4sm29818268edb.16.2017.12.29.17.13.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:13:23 -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, Ray Jui , Scott Branden , Jon Mason , bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 11/33] clk: bcm: iproc: change iproc_pll_round_rate() return logic Date: Sat, 30 Dec 2017 01:12:50 +0000 Message-Id: <1514596392-22270-12-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: Ray Jui Cc: Scott Branden Cc: Jon Mason Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-clk@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/clk/bcm/clk-iproc-pll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/bcm/clk-iproc-pll.c b/drivers/clk/bcm/clk-iproc-pll.c index b5399b2..54e914c 100644 --- a/drivers/clk/bcm/clk-iproc-pll.c +++ b/drivers/clk/bcm/clk-iproc-pll.c @@ -439,7 +439,7 @@ static unsigned long iproc_pll_round_rate(struct clk_hw *hw, unsigned long rate, struct iproc_pll *pll = clk->pll; if (rate == 0 || *parent_rate == 0 || !pll->vco_param) - return -EINVAL; + return 0; for (i = 0; i < pll->num_vco_entries; i++) { if (rate <= pll->vco_param[i].rate) @@ -541,7 +541,7 @@ static unsigned long iproc_clk_round_rate(struct clk_hw *hw, unsigned long rate, unsigned int div; if (rate == 0 || *parent_rate == 0) - return -EINVAL; + return 0; if (rate == *parent_rate) return *parent_rate;