From patchwork Sat Dec 30 01:12:46 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: 10137603 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 49055603FA for ; Sat, 30 Dec 2017 01:20:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C3732D2D1 for ; Sat, 30 Dec 2017 01:20:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30E6A2D31F; Sat, 30 Dec 2017 01:20:40 +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 911842D2D1 for ; Sat, 30 Dec 2017 01:20:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751423AbdL3BTZ (ORCPT ); Fri, 29 Dec 2017 20:19:25 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:44167 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750985AbdL3BNV (ORCPT ); Fri, 29 Dec 2017 20:13:21 -0500 Received: by mail-wm0-f67.google.com with SMTP id t8so50417802wmc.3 for ; Fri, 29 Dec 2017 17:13:20 -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=olOcL0PHWdRXh1+4Iiqb6QR/kZcHmlo1ig2FePjmnrM=; b=O0YYtI97gQZH179tOWagOvk/bxDvv5km/KjdM6+X3kEqVjhjDLJbYjjLh7snVO4CJz cIA9NQ5zqeIYY+OXvHtpebNR/sIUN6VNTGX3GPYHNSSRzWZocwwswqCJITDGlqVjqtUr 5KLYHhl90yNytnLI1SwRzX20Bkef0dd++/49oGsU/xQVXp2+9NXyucqkoExDVIcNZGZP VjrsFUqgxpfLbMxvs2y4nUz2CkN8NaQgpkpjE16iPvO54bagyAlOwb4Jhra7ZOOImpju Y0N1oUR3AQ1riGym1Yd+BuXW60+vaJy78FU1xPKpyLZC+XGXHwSP2/ZgiI3dRv5bXQNs Wdog== 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=olOcL0PHWdRXh1+4Iiqb6QR/kZcHmlo1ig2FePjmnrM=; b=gaUXEUrYWfSw9pXTCMqcrKHBpy+4EQKdW4SdSNBVS/mX7KdO0hBqoFDsqvFg3td7Nv IfAtYqwPm6S7cwgK/0DH8LC3ARaruERsKDV49tf0mZBPkazCdt/mrQuHX84Q7sSg/OzO 48Wces2dlfbRndETfh1m82E1bMZymRTCSNVrhCSzuTW3KcgMSzjFpJGoBTBBEo0mTApO 4Wv1XkrbGdDDbI+rBsHOoFEwPJSyMYAAN9oG6Iqw8h7LA7HbfKKsY+cwUlEN8a4307IP dymEvTkt6TQFYrIt92qRLhocuytlHlZN6ddxmIPDjcIdjqxrftYi32vqBpvIqNrZGb/A Madg== X-Gm-Message-State: AKGB3mKZMmFA3K6ih0I/rvF1GNKmTpCnKI4augFWyA9/TiJYoed/BTNh PT4q6eV6Ozym8EP6TKyHh8PBBg== X-Google-Smtp-Source: ACJfBotxdzj+MlMG25TCD/NdAjnSi23FskSx5OV0ppvcilerTXC8wOey7OVCYj/HoPsqPglL4ojf2g== X-Received: by 10.80.144.72 with SMTP id z8mr46759600edz.105.1514596399746; Fri, 29 Dec 2017 17:13:19 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id h4sm29818268edb.16.2017.12.29.17.13.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:13:19 -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, Eugeniy Paltsev Subject: [PATCH 07/33] clk: axs10x: change i2s_pll_round_rate return logic Date: Sat, 30 Dec 2017 01:12:46 +0000 Message-Id: <1514596392-22270-8-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: Eugeniy Paltsev Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/clk/axs10x/i2s_pll_clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/axs10x/i2s_pll_clock.c b/drivers/clk/axs10x/i2s_pll_clock.c index 061260c..20f7ebf 100644 --- a/drivers/clk/axs10x/i2s_pll_clock.c +++ b/drivers/clk/axs10x/i2s_pll_clock.c @@ -119,14 +119,14 @@ static unsigned long i2s_pll_round_rate(struct clk_hw *hw, unsigned long rate, if (!pll_cfg) { dev_err(clk->dev, "invalid parent rate=%ld\n", *prate); - return -EINVAL; + return 0; } for (i = 0; pll_cfg[i].rate != 0; i++) if (pll_cfg[i].rate == rate) return rate; - return -EINVAL; + return 0; } static int i2s_pll_set_rate(struct clk_hw *hw, unsigned long rate,