From patchwork Mon Jan 1 19:42:46 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: 10139387 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 A060360362 for ; Mon, 1 Jan 2018 19:43:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 924DB28649 for ; Mon, 1 Jan 2018 19:43:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 876AC286B7; Mon, 1 Jan 2018 19:43:34 +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 02E7228649 for ; Mon, 1 Jan 2018 19:43:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932074AbeAATnd (ORCPT ); Mon, 1 Jan 2018 14:43:33 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:46503 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753830AbeAATnZ (ORCPT ); Mon, 1 Jan 2018 14:43:25 -0500 Received: by mail-wm0-f65.google.com with SMTP id r78so58605775wme.5 for ; Mon, 01 Jan 2018 11:43: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=olOcL0PHWdRXh1+4Iiqb6QR/kZcHmlo1ig2FePjmnrM=; b=n1pbIWtpf8EofDxOid4f6P+1edabdtjWkFTF4dyyiAW4Tz+a/p0N3H6aMKpoRicB5z YDYf6S9WpomKP3/mpgJBMklLksjeG1I/tyyU6pz0pvo1OLjbe1bOnnNrKhM0IY2gO4Ul NmeukrryRDtEyPOkG8b/Vh+AQ8TmIOj8+5BQd+d74hqt8Dpbb78Eqy35y1HnrU9xOIi8 tBJxELPjGZOHlqGSey0kKoBEahjZ6c69XL6aPNhbKBnfbbt1rQxvJ/9wIif/iIz0RxSV 4+t6ydmoz3e4ZGGhkcNq/GoW8lUNGsOzHjFhCWsTB9r07BGaQhBN0551MRk01XFQVxHp eMNA== 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=gHKxi0DeM4BUkMd1m5C6xJoYKeR2drtZKcClWNNOqbKrGAdQJoPuC1FDhcBk1JwWoO 6A+NQjFE5n6DbDXnRf+oIk1ZoEegDBR4Hq7N1If9gM6iM3o57w9LRVDWJZj/QF2IzdsS AWMqSISDsjqhloixiuLbIeckEFBuEuCOIZy9xpv4+sQ9JPywo4Fcmmg46fY6WPo9Yxzw yHkMBIE9vnxSCDU7Pe9Q4To03gcwHlCxMCU/Zg+jAgY+3TGLqCyHK8RU25tfhR+9N2Ou QWQs3anf3g9A3PrXbTp1s5ta6yNZ4Ta4D/dTR6KQ5YI4UZG7JZuwrNiqAAfE6HXSJGTK aIJg== X-Gm-Message-State: AKGB3mKtLdNiaDMA9vCTxlWGIugmdOhQhOzY8Glh3Lkn9tsSJT0nrXLH +NBscjuWVwYIwW+MbFFrDGRtkfwG X-Google-Smtp-Source: ACJfBot1Bx9nyh0RQk5L8SPBIIOcbD6hJubuSr95egVI54Y0t9ViCBo8r8YCZcw1nyNkRvkfUiqncA== X-Received: by 10.80.245.26 with SMTP id t26mr23860782edm.301.1514835803955; Mon, 01 Jan 2018 11:43:23 -0800 (PST) Received: from localhost.localdomain (D4CCACC7.cm-2.dynamic.ziggo.nl. [212.204.172.199]) by smtp.gmail.com with ESMTPSA id w2sm39361075edb.4.2018.01.01.11.43.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jan 2018 11:43: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: Bryan O'Donoghue , Eugeniy Paltsev Subject: [PATCH v3 07/34] clk: axs10x: change i2s_pll_round_rate return logic Date: Mon, 1 Jan 2018 19:42:46 +0000 Message-Id: <1514835793-1104-8-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514835793-1104-1-git-send-email-pure.logic@nexus-software.ie> References: <1514835793-1104-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,