From patchwork Mon Jan 1 19:07:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 10139239 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 63F8B60596 for ; Mon, 1 Jan 2018 19:09:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 576FB286AB for ; Mon, 1 Jan 2018 19:09:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C89628765; Mon, 1 Jan 2018 19:09:13 +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 CC48D2875C for ; Mon, 1 Jan 2018 19:09:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752633AbeAATIl (ORCPT ); Mon, 1 Jan 2018 14:08:41 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35084 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752575AbeAATIN (ORCPT ); Mon, 1 Jan 2018 14:08:13 -0500 Received: by mail-wm0-f65.google.com with SMTP id a79so19001497wma.0 for ; Mon, 01 Jan 2018 11:08:12 -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=PVkAiDg2Y33M+YjtdYs7tkcMcB+3U0CQOvDgAqUH2AQZi43zOb4UapY+lPJLI96ZuE A6QP736CxQuDOf2QdZygLMzD8t5B3JyFxIfdOdHuYcKd4ubuDkQhs9FsqEkb14cxoIzu EllAlphpq4Mio5CfwdiaYx8OWaY+QgIwBEIIyunMEKvZK9OA6bpeQqpPqcpaf/xv6xiv heP+bwpPwQFY6Qtyyh3ZbxLU5AdLP7qhMtG4ehZaAUIJ262s+h75vYI1+Y4YzXd6OTMz tlpCs8N153+81UEoZvLStWo5Y1TNbAUw9bmaTqm40sbJ2jGXRnWs0doAtqG3dTlaBDtc x+CA== 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=ZQQC2qVuUuqQ/Mg/dcg8Hgrbo7SfcaCRwNT8yvk7QvbGkoYfIOG0qQER01FZ8KAO30 +5yxCnuvkZbtwhkmQtNu7MzWmTicSWqiYKBkZ7MVirz+LpjJrsOwUq65tuFrqI5MIrHt BdDgwaj4Fpp4jNXqYffzNZGfK4pKAI5bbVVnuah629L4VLO4rR5cbl9d7ltVN06E5qRI 8PXNkP6HEi5Z1K3You3NSdWMdsZZk8/nc7FpgW2osoBx2HrpxQAdInXRrih6Xr+wVSqv WsR91piNQ1I6IqcIZc2ocRucbwQmQ4evzxa9AWBgt0mzN85v+xlaDVzfl89PnYpNNa0U 0GYw== X-Gm-Message-State: AKGB3mJQ8KYWtXyApjt8tMJAl6YCYg02PwWzwG6Bhv6BKkx0EyUzVZ/I uoBk0smICKde9RbbH+OGUt2F2Q== X-Google-Smtp-Source: ACJfBotHeF2JgBWNypnmqYUa3K/2I4RngrUlhO9XT3H8g31OunU93cxSJcrOI0Iq7h+gKjnHHmZJug== X-Received: by 10.80.135.182 with SMTP id a51mr57220503eda.98.1514833692375; Mon, 01 Jan 2018 11:08:12 -0800 (PST) Received: from localhost.localdomain (D4CCACC7.cm-2.dynamic.ziggo.nl. [212.204.172.199]) by smtp.gmail.com with ESMTPSA id v15sm33236633edb.41.2018.01.01.11.08.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jan 2018 11:08:11 -0800 (PST) From: Bryan O'Donoghue To: mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Cc: Bryan O'Donoghue , Eugeniy Paltsev Subject: [PATCH v2 07/34] clk: axs10x: change i2s_pll_round_rate return logic Date: Mon, 1 Jan 2018 19:07:34 +0000 Message-Id: <1514833681-30737-8-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514833681-30737-1-git-send-email-pure.logic@nexus-software.ie> References: <1514833681-30737-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,