From patchwork Sat Dec 30 01:12:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 10137543 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 8906B6037D for ; Sat, 30 Dec 2017 01:17:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C54E2B551 for ; Sat, 30 Dec 2017 01:17:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 717292B55D; Sat, 30 Dec 2017 01:17:59 +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 EAC442B551 for ; Sat, 30 Dec 2017 01:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751154AbdL3BNc (ORCPT ); Fri, 29 Dec 2017 20:13:32 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33455 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062AbdL3BN0 (ORCPT ); Fri, 29 Dec 2017 20:13:26 -0500 Received: by mail-wm0-f67.google.com with SMTP id g130so7023731wme.0 for ; Fri, 29 Dec 2017 17:13:26 -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=VxG0B7zKscnKDy+Li+HZ7cbwlEb/cXTKURAWIwPT8r9otsXnZvYadwbJ5/hMXKMj0R ASLcX9Fd/1YZyNcZ9eBO/womkRnZqi9R2hPB86gc4GIY6ICgO5Q6gjZHy9bIWH7kQ+S2 8ZqF03wcpKiwhT0I8kHkXDccCKrpxPzQ7BxTgvqYD3uhNyYDHStLgMdWdIfjqQ7DMvbj EAsShVnAma87/ubguARM3oChFoeliZiDdjdJbIInoUsR26daunBQDp2HR0Gm3ZSmggtm CxJN02jUlhYrr32cat4+o7w/+NGW0LeAlPC7bmR+SY76EEeTMCoaLycYeMqEShKDZRtS /oGw== 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=eSEPoCtxF4mNMVBk+eIfZRcQq0vcuQmsOL+vxVpKdt/BGJ12ZuAh0qioHm2rEMf0KX 9wMro19qVdzKPG3tUHfc7dpmKXBBwwhy7iSiH52lV+0mp1OsVbKnoSc8/US//K7WxVwz CQnEWCXYGxSR+Z64wtatzTAkTi8L4ZVmSAGnMw2toMnWA6JnfkDZ5P8srdVwC/vzjc2D uFbeZXERWtMfdKBg7o1jP9z4HZfHwVPlwX7pvcEwUmAm65lBG3Ky3VVW1XE2b1ux4qqv LBQ3OICppx0GH8+c0Crdjylrh+kCUnLUt2GXC8LGZLd5kRYAYsYW1XHg0sEQSxP0Xa+C SXWQ== X-Gm-Message-State: AKGB3mIagFnKjmjuofrdZWrSzoVjvBVRCaOoDFX9DYXAMrxPrb9FAA1W YvF7hePgwi29aXRD48ogaIHKPg== X-Google-Smtp-Source: ACJfBourTxzkP+jWB4+d7GVNLHZ6FAu8Fq4QzEDIMqB4YuC3CC58bKN2pJjhdkJSq0yZD4NfQnwP7w== X-Received: by 10.80.179.187 with SMTP id s56mr45907793edd.87.1514596405514; Fri, 29 Dec 2017 17:13:25 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id h4sm29818268edb.16.2017.12.29.17.13.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Dec 2017 17:13:25 -0800 (PST) From: Bryan O'Donoghue To: mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Cc: pure.logic@nexus-software.ie, Mike Looijmans Subject: [PATCH 13/33] clk: si514: change si514_round_rate() return logic Date: Sat, 30 Dec 2017 01:12:52 +0000 Message-Id: <1514596392-22270-14-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514596392-22270-1-git-send-email-pure.logic@nexus-software.ie> References: <1514596392-22270-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); }