From patchwork Tue Dec 10 02:18:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 3314011 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D92259F37A for ; Tue, 10 Dec 2013 02:18:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 07190202C8 for ; Tue, 10 Dec 2013 02:18:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28D60202B8 for ; Tue, 10 Dec 2013 02:18:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751510Ab3LJCSY (ORCPT ); Mon, 9 Dec 2013 21:18:24 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:9721 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133Ab3LJCSX (ORCPT ); Mon, 9 Dec 2013 21:18:23 -0500 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Mon, 09 Dec 2013 18:18:20 -0800 Received: from hqemhub03.nvidia.com ([172.20.12.94]) by hqnvupgp08.nvidia.com (PGP Universal service); Mon, 09 Dec 2013 18:11:28 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Mon, 09 Dec 2013 18:11:28 -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, 9 Dec 2013 18:18:22 -0800 Received: from sc-daphne.nvidia.com (Not Verified[172.20.232.60]) by hqnvemgw02.nvidia.com with MailMarshal (v7,1,2,5326) id ; Mon, 09 Dec 2013 18:18:22 -0800 Received: from tamien.nvidia.com (tamien.nvidia.com [172.17.186.57]) by sc-daphne.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id rBA2IMvX025793; Mon, 9 Dec 2013 18:18:22 -0800 (PST) Date: Mon, 9 Dec 2013 18:18:22 -0800 From: Paul Walmsley X-X-Sender: pwalmsley@tamien To: Santosh Shilimkar , Viresh Kumar CC: , , , Subject: [PATCH] cpufreq: omap: clk_round_rate() can return a zero upon error Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Treat both negative and zero return values from clk_round_rate() as errors. This is needed since subsequent patches will convert clk_round_rate()'s return value to be an unsigned type, rather than a signed type, since some clock sources can generate rates higher than (2^31)-1 Hz. Eventually, when calling clk_round_rate(), only a return value of zero will be considered a error. All other values will be considered valid rates. The comparison against values less than 0 is kept to preserve the correct behavior in the meantime. This patch also removes a bogus usage of IS_ERR_VALUE(), which is intended to be used only on combination pointer/error code return values; a side-benefit. Signed-off-by: Paul Walmsley Cc: Santosh Shilimkar Cc: Viresh Kumar Acked-by: Viresh Kumar Acked-by: Santosh Shilimkar --- Applies on v3.13-rc3. See also: http://marc.info/?l=linux-arm-kernel&m=138542591313620&w=2 drivers/cpufreq/omap-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index a0acd0bfba40..0f41eb2609f3 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c @@ -63,7 +63,7 @@ static int omap_target(struct cpufreq_policy *policy, unsigned int index) freq = new_freq * 1000; ret = clk_round_rate(mpu_clk, freq); - if (IS_ERR_VALUE(ret)) { + if (ret <= 0) { dev_warn(mpu_dev, "CPUfreq: Cannot find matching frequency for %lu\n", freq);