From patchwork Tue Nov 26 00:16:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 3235581 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 916B3C045B for ; Tue, 26 Nov 2013 00:52:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C56622021F for ; Tue, 26 Nov 2013 00:52:05 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CEC71202D1 for ; Tue, 26 Nov 2013 00:52:04 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vl6M6-00041J-P8; Tue, 26 Nov 2013 00:18:19 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vl6Lc-0004J5-DL; Tue, 26 Nov 2013 00:17:48 +0000 Received: from hqemgate15.nvidia.com ([216.228.121.64]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vl6Kf-0004C1-Lu for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2013 00:16:50 +0000 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Mon, 25 Nov 2013 16:16:17 -0800 Received: from hqemhub03.nvidia.com ([172.20.12.94]) by hqnvupgp08.nvidia.com (PGP Universal service); Mon, 25 Nov 2013 16:10:13 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Mon, 25 Nov 2013 16:10:13 -0800 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQEMHUB03.nvidia.com (172.20.150.15) with Microsoft SMTP Server id 8.3.327.1; Mon, 25 Nov 2013 16:16:27 -0800 Received: from thelma.nvidia.com (Not Verified[172.16.212.77]) by hqnvemgw02.nvidia.com with MailMarshal (v7,1,2,5326) id ; Mon, 25 Nov 2013 16:16:27 -0800 Received: from tamien.nvidia.com (tamien.nvidia.com [172.17.186.57]) by thelma.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id rAQ0GROJ022448; Mon, 25 Nov 2013 16:16:27 -0800 (PST) Date: Mon, 25 Nov 2013 16:16:27 -0800 From: Paul Walmsley X-X-Sender: pwalmsley@tamien To: , Subject: [PATCH v2] clk: clk_round_rate() should return 0, not negative numbers, upon error Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131125_191649_830670_A01262AD X-CRM114-Status: GOOD ( 12.66 ) X-Spam-Score: -1.9 (-) Cc: Russell King , Mike Turquette X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some clock sources can generate clock rates higher than (2^31)-1 Hz. Currently, if these rates were returned from clk_round_rate(), they would be considered errors according to the present function prototype and return type. This patch updates the documentation for clk_round_rate() to state that it should return 0 rather than a negative error code when it encounters an error. The common clock framework already works this way; however, other clock code does not yet align to this. A future patch will modify the prototype to return unsigned values from clk_round_rate(). This second version revises the patch description in response to comments from Russell King. Signed-off-by: Paul Walmsley Cc: Mike Turquette Cc: Russell King --- include/linux/clk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/clk.h b/include/linux/clk.h index 9a6d04524b1a..ffbbb7b2de43 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -228,7 +228,7 @@ void devm_clk_put(struct device *dev, struct clk *clk); * @clk: clock source * @rate: desired clock rate in Hz * - * Returns rounded clock rate in Hz, or negative errno. + * Returns rounded clock rate in Hz, or 0 upon error. */ long clk_round_rate(struct clk *clk, unsigned long rate);