From patchwork Mon Jan 1 19:42:50 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: 10139389 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 C947460362 for ; Mon, 1 Jan 2018 19:43:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B961628649 for ; Mon, 1 Jan 2018 19:43:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADBB1286B7; Mon, 1 Jan 2018 19:43:39 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3228A28649 for ; Mon, 1 Jan 2018 19:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=P1ttDdndxaVUxcwotsDpWe9v0jj5JinNL7ir4GLIkss=; b=bB3pozwbiTADTrZCB2brKa9bFx gCnBJCt1eAuMMriyVkpZdx4JLlLxxAI1HhdI0oanBUo6qArRhf8RrQ/buwA5hM6kiUkRoVLJr83yc JmkffoRylMic+ouTx8/T2ZOU/7m9/IT0APfW1s6q0+1fGqYOwlG15J+FD5dg85Eb7Xkb4lgLfpZPD pAIh0etH05zJrEIMaKcxYmkn5WHimOCImbLQ3i9w84zhME+XWpmVFjWevn29MyVaJnmMZ0tk3dJnB 0pevVrVZPX0E0mSeX8Q2Wx/XDZuJ/1yvN8NTLfABNzZ7kiqtikVtI9m0ECYSGA1ei2O7DJ7DytNxg Y3T53dCw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eW5zk-0003Bo-B5; Mon, 01 Jan 2018 19:43:36 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eW5ze-00039b-Ry for linux-arm-kernel@lists.infradead.org; Mon, 01 Jan 2018 19:43:32 +0000 Received: by mail-wm0-x241.google.com with SMTP id g75so58610322wme.0 for ; Mon, 01 Jan 2018 11:43:29 -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=rJSOxvQ+UuDiwk1jYvhD73JGw3GfTH2sBrWtud0TcCc=; b=s6E3BdDQz06UBFlGwc3ENdIqprV/czOtUutKmh8A/NyaEKr07Tl//GdjXJP46idkmt 7q4aQZKoQ3X5CqsVVucG5t23jmJ1YY/R5PNC313HWKqA3NBDMsdhCl1or2y3MmNXaqBZ T+du31kTsc06uZ7eUEwD8F3sFQQnrvJKLf+Fl7Eaeum3yKUtm4Z8rxhMbJkgUBie8fSn CYzmsYFDg0S5MZM7h05imTDuDr5t9Z5oGk4SpqOatdRGe03Gmts90v8XvOIpjXu527wV LUGHbCu0H/Lz+5pGgIafWD1m4aGZ1Rks7bG01dCYbLwt8+HCt1zadBLsQlU+woAHNoEA 4yhQ== 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=rJSOxvQ+UuDiwk1jYvhD73JGw3GfTH2sBrWtud0TcCc=; b=Al3M/9y7Y9bf8nS7q3e9Jq9E15ekVpLgwCw/FXrEX+bEXsYWktEQh2QzO0e7yyUyMq uFqDWV/o8wpkx0C/jcyZ8d6wrcFSaODD2qX6vqQ4H46mo4duIU96tb1qXgPLzGqpcx40 oAFZp4lD72maSXLs/Iz9SKvM8DLsc3Loa7OjW2MDCjdkRzSu+9eFcXmQWn6ORRQpmdtg zRz0Rkba8MDqtFSPjqyRq/sVNmeaBDjmmjnTRvoX7f3fAEkdcGfd1V9MhgV89A9VrOgV 3Frv/V7Apq2vhWKAaWWGG5Er5E40IhPqlNXIMgV1bgJKRQEBwbbsqNG6GPSM/3pFyd2w RRqQ== X-Gm-Message-State: AKGB3mKR9rFZwewb2GFM25EVKMAxsDu9KPtbbmG6mrWYSHyYwaBgvkQp 3i8Kcq1ZzTVdRhGuPJnZ6sF5oQ== X-Google-Smtp-Source: ACJfBovx5anHTkLU3oiz/4TnRhWp3zm+0XUY7QNxqPwSJsyEYBZL1EYU/QBxDi4lRbdnfFbx6NORqg== X-Received: by 10.80.180.187 with SMTP id w56mr59913984edd.3.1514835807880; Mon, 01 Jan 2018 11:43:27 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jan 2018 11:43:27 -0800 (PST) From: Bryan O'Donoghue To: mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v3 11/34] clk: bcm: iproc: change iproc_pll_round_rate() return logic Date: Mon, 1 Jan 2018 19:42:50 +0000 Message-Id: <1514835793-1104-12-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180101_114330_964355_7315B716 X-CRM114-Status: GOOD ( 13.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Scott Branden , Jon Mason , Ray Jui , bcm-kernel-feedback-list@broadcom.com, Bryan O'Donoghue , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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: Ray Jui Cc: Scott Branden Cc: Jon Mason Cc: bcm-kernel-feedback-list@broadcom.com Cc: linux-clk@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/clk/bcm/clk-iproc-pll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/bcm/clk-iproc-pll.c b/drivers/clk/bcm/clk-iproc-pll.c index b5399b2..54e914c 100644 --- a/drivers/clk/bcm/clk-iproc-pll.c +++ b/drivers/clk/bcm/clk-iproc-pll.c @@ -439,7 +439,7 @@ static unsigned long iproc_pll_round_rate(struct clk_hw *hw, unsigned long rate, struct iproc_pll *pll = clk->pll; if (rate == 0 || *parent_rate == 0 || !pll->vco_param) - return -EINVAL; + return 0; for (i = 0; i < pll->num_vco_entries; i++) { if (rate <= pll->vco_param[i].rate) @@ -541,7 +541,7 @@ static unsigned long iproc_clk_round_rate(struct clk_hw *hw, unsigned long rate, unsigned int div; if (rate == 0 || *parent_rate == 0) - return -EINVAL; + return 0; if (rate == *parent_rate) return *parent_rate;