From patchwork Mon Jan 1 19:34:41 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: 10139279 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 F0111603B4 for ; Mon, 1 Jan 2018 19:34:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7D66284C9 for ; Mon, 1 Jan 2018 19:34:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAEFE2850D; Mon, 1 Jan 2018 19:34:48 +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 49F46284C9 for ; Mon, 1 Jan 2018 19:34:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752939AbeAATeq (ORCPT ); Mon, 1 Jan 2018 14:34:46 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:46547 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752614AbeAATep (ORCPT ); Mon, 1 Jan 2018 14:34:45 -0500 Received: by mail-wm0-f67.google.com with SMTP id r78so58586714wme.5 for ; Mon, 01 Jan 2018 11:34:45 -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; bh=/Ew1e2Y3RRnLbMCn65IP31g+cr1NpCGL7wwcmcWXxkc=; b=2M+maUVKk4DfX4PR7ylUSBLfLI0Gvojpzqz72BYtDYxqM30HNLmZfPPzrsa4w5Xb/+ 3rGFT4ii5UpeFXFqu+17G/X9Ml+kYMlbSsGAqamtzmuTFvJoZls3NXAwHSfNWFvMr/GD AH6x0O3tbiL0RPsfg/dZfRtfQh/FxQ6EPxCxLyPAkPv7IVVxTEplyJhGYNXG6I2+OCxV 6fzCsWqbNFDzz7ghXKUgi1Ohz8fjaSA8wNvoFX4L8o4lAQ1iIJVZoqVjkkzJqIeghoXH j1oV7h9tCJy7Dssr3eBNCnC/l7pT5TRBmNBpz39mgH878jVkLiIuvB/QiG2H8xliBqpf bAcg== 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; bh=/Ew1e2Y3RRnLbMCn65IP31g+cr1NpCGL7wwcmcWXxkc=; b=t2HQTaXJ4gHWFCjECbABUs27EQHAvKGRfpsLhuafnxWFOgqPHiodwJ6YjnFvksaS6a sm3Sn9MMU4vWua2fm0gh/4Mwx8G0Rr52EcaYKXftEIjmzS5gNSeG6SvgW1bb9z/mUiI2 r4xfuGTEuiUfa+vKlVsZfp8qcuCuVC/SAx1AyD/t3HEfORHqzKLDYGYEHu0tS3LH0C91 kP4qSQNlQXJ67Z8WEl09E/X02p/OZbAJqbvn6RlAXiIuR/RxaCbv9HiimgB0vOSnyr1s rjrl4ZN1vTLpwZm10V6uAxjGkyx2neSMmLsu1dM59o4rYr/NL2JGL1nkkW7kx8mWAiZb +GRg== X-Gm-Message-State: AKGB3mIx/rUBiAD9tp79JvaTXon0kMEEmjcs2fpPBiCaNioll/qus85H YY3lPiNk3mKKYg70ku6WYYJD3CPtrGw= X-Google-Smtp-Source: ACJfBov8KtSmfWRqdLP8kdnwMAqXuPqELRf5wOr0wghuud/uciU40R0WXSfN4hY1XWtEdwIj6MhwBQ== X-Received: by 10.80.147.14 with SMTP id m14mr58650396eda.121.1514835284721; Mon, 01 Jan 2018 11:34:44 -0800 (PST) Received: from localhost.localdomain (D4CCACC7.cm-2.dynamic.ziggo.nl. [212.204.172.199]) by smtp.gmail.com with ESMTPSA id s7sm40796601edm.80.2018.01.01.11.34.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jan 2018 11:34:44 -0800 (PST) From: Bryan O'Donoghue To: bryan.odonoghue@nexus-software.ie Cc: Bryan O'Donoghue , Marek Vasut , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Barinov , Alexey Firago Subject: [PATCH v2 15/34] clk: vc5: change vc5_dbl_round_rate() return logic Date: Mon, 1 Jan 2018 19:34:41 +0000 Message-Id: <1514835281-324-1-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 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: Marek Vasut Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Vladimir Barinov Cc: Alexey Firago --- drivers/clk/clk-versaclock5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-versaclock5.c b/drivers/clk/clk-versaclock5.c index 9432122..733b402 100644 --- a/drivers/clk/clk-versaclock5.c +++ b/drivers/clk/clk-versaclock5.c @@ -294,7 +294,7 @@ static unsigned long vc5_dbl_round_rate(struct clk_hw *hw, unsigned long rate, if ((*parent_rate == rate) || ((*parent_rate * 2) == rate)) return rate; else - return -EINVAL; + return 0; } static int vc5_dbl_set_rate(struct clk_hw *hw, unsigned long rate,