From patchwork Mon Jan 1 19:43:07 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: 10139455 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 85EB660362 for ; Mon, 1 Jan 2018 19:46:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77B5E286FB for ; Mon, 1 Jan 2018 19:46:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CA11286FE; Mon, 1 Jan 2018 19:46:45 +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 E101E286FD for ; Mon, 1 Jan 2018 19:46:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932207AbeAATpt (ORCPT ); Mon, 1 Jan 2018 14:45:49 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:32822 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932202AbeAATno (ORCPT ); Mon, 1 Jan 2018 14:43:44 -0500 Received: by mail-wm0-f65.google.com with SMTP id g130so14017681wme.0 for ; Mon, 01 Jan 2018 11:43:44 -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=mXGNwLkTWl9eP5QOuBOFDJYMtp2yxKgq1GbBL/CcrjY=; b=t1tG2j2Jo84rCARYenkzTpkUWrQfViMLiIV+LhHgZ21pcOBKRO9o3WKrxQP3L9z4vb RN/X6mDSxU7gonDR0CFaImb3AaYXeuUlUlg8pe73iFpObJq1dBIQP3mumf3x0YqHF4Ap Zn/OsZ2Gwhw0zpQv32Mr7d9gZ/dNzD4JeVXv6hEH1sKExyMMVWUl6o7lDQm7Srn+a/gJ qMIvPskXTzcqFajsuED0vH8Vd7EN5GqfT2M7igw870kwmKBdgfDLkg84zJ/78eN31pnO NT9s4He1Mwp2xNA7l09qsCEX88oWheiVXTUKUPk3ryRBsJR0isXiWV4dh+PyZ/K2G8tH vUeA== 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=mXGNwLkTWl9eP5QOuBOFDJYMtp2yxKgq1GbBL/CcrjY=; b=p63I6KKRdrsJW1HXJLFhBnqxCsjoUBhIGiNUQQWlzaf8K2wkf22gzWSp9KiwBe2XlM wqWy3O+6mc21NFT0yP7Jy35+QTkau3ngCP0AoZKqmJmZcbtvY3THXH9xxtzecl4g8PTT NNPux7e/wcfsNSJxqhwSlPwnpjlp8k7TWxbS/WCDalemeKqco27CZnLqvjd20j7i4VNr BRKJ9x1XTPp5/rxXRsnvc6nkHz3xb6vGVZupoYZuMT4vzPRYFbbJ4wEQN5JvzK08Dhs0 7infZgFwgrJk7EsvyF/ajWn5PCDiovHWdxWImyxZjLq+t6Dk9NY0uagRiduEnIS6FQAe BtfQ== X-Gm-Message-State: AKGB3mL9hO9jQFEZJ1rFEeq1/a1rPAl2EDZsnmM/3zTlSFlhlQ39KbNR qWP5Ay+DBC6IRdpERlXzIpo4ItxW X-Google-Smtp-Source: ACJfBotRi0hIsvAUoDTtZ7fALo1+Hz8i8fa8RaBdRJidKLaVs57viRBvicTMWG0z1sMz5a8xjBg91g== X-Received: by 10.80.154.67 with SMTP id o61mr29424155edb.291.1514835823587; Mon, 01 Jan 2018 11:43:43 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jan 2018 11:43:43 -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 , Tero Kristo , Tony Lindgren , linux-omap@vger.kernel.org Subject: [PATCH v3 28/34] clk: ti: fapll: change round_rate() return logic Date: Mon, 1 Jan 2018 19:43:07 +0000 Message-Id: <1514835793-1104-29-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: Tero Kristo Cc: Michael Turquette Cc: Stephen Boyd Cc: Tony Lindgren Cc: linux-omap@vger.kernel.org Cc: linux-clk@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/clk/ti/fapll.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c index 2e74437..f435a8c 100644 --- a/drivers/clk/ti/fapll.c +++ b/drivers/clk/ti/fapll.c @@ -227,12 +227,12 @@ static unsigned long ti_fapll_round_rate(struct clk_hw *hw, unsigned long rate, int error; if (!rate) - return -EINVAL; + return 0; error = ti_fapll_set_div_mult(rate, *parent_rate, &pre_div_p, &mult_n); if (error) - return error; + return 0; rate = *parent_rate / pre_div_p; rate *= mult_n; @@ -414,7 +414,7 @@ static unsigned long ti_fapll_synth_round_rate(struct clk_hw *hw, unsigned long r; if (ti_fapll_clock_is_bypass(fd) || !synth->div || !rate) - return -EINVAL; + return 0; /* Only post divider m available with no fractional divider? */ if (!synth->freq) {