From patchwork Mon Jan 1 19:42:52 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: 10139529 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 CE181601A1 for ; Mon, 1 Jan 2018 19:50:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD81728617 for ; Mon, 1 Jan 2018 19:50:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B23D8286C0; Mon, 1 Jan 2018 19:50:50 +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 332C428617 for ; Mon, 1 Jan 2018 19:50:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752084AbeAATtv (ORCPT ); Mon, 1 Jan 2018 14:49:51 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:46517 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753851AbeAATna (ORCPT ); Mon, 1 Jan 2018 14:43:30 -0500 Received: by mail-wm0-f67.google.com with SMTP id r78so58605984wme.5 for ; Mon, 01 Jan 2018 11:43:30 -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=JI1q+EaLHs2mirXP0XC4BD2PYvqtiFHE4HmhBhxzjRI=; b=CIIJLbALK5gUGPz+WPexNmmaCwArUstXTjbvjpE+eiMb90qGmaWfCSHWkTeWZgumRP h/1LFJg/xUVe7PxuB2+CRV7mMAJdtjoXf8WM8BfLHrbJmvdyYHkLziW2FXogHLiSq75z w994jsUWzNO24ixANMW2Y0yiHlh59dcEM6n8BDgJdLRWLcZm05Q4vErIAJBQf1LYf9Su KafVLBGel8L8YBfGQX1ArLFH77V/QkktHGhFSV5djC+thGqNrDM70Cw7Yj/aOk2PJAbT 822VOyh44Q6Hfbva+/hSxzSJDyFNlxiDiXrhWfFvrQP/0XR9vo5TbjLD2QZioLq4Ihey AGeg== 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=JI1q+EaLHs2mirXP0XC4BD2PYvqtiFHE4HmhBhxzjRI=; b=fgcXI/mP+HzfX4kaU3oEU5Mg6+CvfLMr4v+4QeqcOT4RbOIRysIphltoAG6jPlSNcX RUsJV5FTn0WREfjg00BA0xgh+Q4e6yAm9keAWXGZn1iGqI6wZuhERAOJ3Vu5QuQul547 +EASMtBtrKXES+AUpzccw8L49Aogjt3qewpRdxF2/b3F5/LzfNMi6073H1CKwASpF5VF SplMIK8B+R+S6Qs5uZnp3hxoO3DIZPK7u/fhHWXpOCuxUlvUxfIAeeFgyCxSx6rpQu05 4MzRlLYcca/ymBBzAI29+4sApHcUReUiwpWjCdFRDKailmLV1rQw7PJ+Ix2g6YAFIR92 rj3g== X-Gm-Message-State: AKGB3mLbxnPx4HX6BgNk0YW/pIVV3bD+fzKyeb3lw+yZNwd1lWThyo2X Qz7zzJlC4+oRfx+hpHGm0pDOPQ== X-Google-Smtp-Source: ACJfBosGiSb23kKV3WkR9G4o7U3kY2PDZIqroCj12bFh3/yWcnmJfdcA1RTw6HyhmNuvOCliGZ9i2Q== X-Received: by 10.80.165.226 with SMTP id b31mr58555132edc.172.1514835809794; Mon, 01 Jan 2018 11:43:29 -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.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jan 2018 11:43:29 -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 , Mike Looijmans Subject: [PATCH v3 13/34] clk: si514: change si514_round_rate() return logic Date: Mon, 1 Jan 2018 19:42:52 +0000 Message-Id: <1514835793-1104-14-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: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Mike Looijmans --- drivers/clk/clk-si514.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-si514.c b/drivers/clk/clk-si514.c index 8d940d0..042ae39 100644 --- a/drivers/clk/clk-si514.c +++ b/drivers/clk/clk-si514.c @@ -220,7 +220,7 @@ static unsigned long si514_round_rate(struct clk_hw *hw, unsigned long rate, err = si514_calc_muldiv(&settings, rate); if (err) - return err; + return 0; return si514_calc_rate(&settings); }