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: 10137489 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 277146037D for ; Sat, 30 Dec 2017 01:15:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19EB02A95E for ; Sat, 30 Dec 2017 01:15:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0ECA72A91B; Sat, 30 Dec 2017 01:15:42 +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 A597B2A79C for ; Sat, 30 Dec 2017 01:15:41 +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=P1ttDdndxaVUxcwotsDpWe9v0jj5JinNL7ir4GLIkss=; b=R8AdAs0Dfzvt/LhFGelJ57IytB UojoqnS5tHnQpxNqwehlLzdn2OjvlXuUJrpYcjVUkRJ42m+wB9Qg3iSCeP6xDhSCmKhCFMx0jODin d3b+APu54R9LBgiyxmXcTnFRrDz3gjV6StkOwOw5msU6Kd6vwXroDjF+a8zUWGUg8+mKoJjjZYbGE WPSDDDt+wsbrH/BywjqSlNoRCrXvG0v4ZwSxnJUpmkYiSXE9YZDc9VdnGzoaiR+5MMgLmchmHIaZr BXaWmDw11WGuWj5HSSAuhUJYZC5efdip7QKnRib4J0HFxn1DYBSCJxNleb9ZUaWgKR49LKMq/WnpB BB1yEMLQ==; 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 1eV5kR-0003hV-7J; Sat, 30 Dec 2017 01:15:39 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eV5iK-0001K2-R6 for linux-arm-kernel@lists.infradead.org; Sat, 30 Dec 2017 01:14:06 +0000 Received: by mail-wm0-x242.google.com with SMTP id f206so50077911wmf.5 for ; Fri, 29 Dec 2017 17:13:25 -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=ZF+ZFCR91pgecfIaDdriH9gzJOfEIz1YhAkhtRroL5xBLOZezSOP/4SaCse22b0T4J CZQ+BYqHR/nRYKKbN964vDtWF1wSFL8oEJeJwAbnZ0KsvJAGVsLr/ZwN41CM6b0fq7bp W1bcajrXucYTIaghVMLipXezfPmx6BRLBXT87ffFgxGkJ1nrFdXLR8x+ZrmeMkGT63Mv rc2IAbPLawTSltqjSPBGKi4QwV5gyR5cons2KqkezEDYiIEBkGQ5W5VBv2q1d2yy+vDS 1IjAH8XWlDMKmVA9VyO/rnIVxrvX2rxKOrvd5sZL6xYjvbtHnsPQyh+LO6Z6ZjxfKQyt 4sIg== X-Gm-Message-State: AKGB3mJY8e+taWdH+KGcJ7KM1/T9wjI25KVxuPcRWLI4xhtoL/e6Kl/T AXg5Xa4Fl/pi6WCOq2OyGXfcQg== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171229_171329_009603_7F32A769 X-CRM114-Status: GOOD ( 13.11 ) 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: Scott Branden , Jon Mason , Ray Jui , bcm-kernel-feedback-list@broadcom.com, pure.logic@nexus-software.ie, linux-arm-kernel@lists.infradead.org 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: 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;