From patchwork Mon Jan 1 19:07:31 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: 10139251 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 280C76035E for ; Mon, 1 Jan 2018 19:09:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AE4E286AB for ; Mon, 1 Jan 2018 19:09:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FC3928765; Mon, 1 Jan 2018 19:09:42 +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 BA39A286AB for ; Mon, 1 Jan 2018 19:09:41 +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=fbEHFKUqOT730Z0Y3TgSpuj6pE62XR8by2Es8lDoeB8=; b=ZIfl8hRd2H722X6bqQzrCopsRE Rdgq/9K6wqwq7yfcsZ3jE/ludZIVUlg2xqrW1Orq0gzAK56jgDRxz66cfDUbu4PpVov/PxRSB4YEe GCpAtnkhWKcnyLrUoc9pvtxksum+rJRwiZoXx8DzP36klXe9a3AXPpTuMidiNqYwQw0Np4z5YRGKh 8MOWix2dOZn+knvQeU/I4YaK8WGk3Nl+PoltbQowbH7lrQ/lxSGSEdXFK7tqcmMQtJ1IyI76ijh/O nNMoZpNodQsu+KLFnBeHhJSUdl9V30MbH5kMX0aP5vGxlg4fWDm6JVB+Fct7vG4XEQLWP/90ATnAF /g3GZNOQ==; 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 1eW5Su-0004qn-9n; Mon, 01 Jan 2018 19:09:40 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eW5Rd-0004Td-4O for linux-arm-kernel@lists.infradead.org; Mon, 01 Jan 2018 19:08:39 +0000 Received: by mail-wm0-x244.google.com with SMTP id y82so13906529wmg.1 for ; Mon, 01 Jan 2018 11:08:10 -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=D2Jb+Ht6+M8pSg9fZx2c8bkCrTeLjA758N+NDr22qY4=; b=mgP1LK/c0tbh2+wxwuvVBD/MIOgSIpKRE8Z8Ov6ItqvOKS74SZEhi1xhD3yN3qDiq8 1jvn5tG7SSMgLzsRMFiHFmiEamnHzENeT8i9A893ATu3rs4YtQT9VTuqg1WkUBmcjdtn bjmEKM1vmFyuhroG2kleCYfBntiSkZtaIGgnq+YXyPB0SFdkZOUeCwq49Sg+tz3O5iWg dJy+3U11+RBx9SrcJIkQPnljrFIHWGduh8j75HuX7n8mOWijHgkYbglTlMlg7D5YpUFN F5C/KIXUCDImHk8F+gV42jhzn1VpM44D1iKgCxkZOFdSQ7BIU+zrD49BYiqQ4PFgYmbI Yi/Q== 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=D2Jb+Ht6+M8pSg9fZx2c8bkCrTeLjA758N+NDr22qY4=; b=VEkphmns8VHdLgBNR5fWTK7cmq6dfY49HJHNfPSjC5QlUSHzgzviI9c8y//9ripLt/ BNFm7ZlAZdBTd/uODqO7lIVJoNQMyJrWs7mr0rYDbeOV4ePAqEkfp50oEuPPsqFv1wJX 2FU9UmBKZFBOjze/UqQ0tGlh3+ZZTC7aXaillg370S3i58bsuxABsSBOi808HrN5mK/W GUAe/BlJ2ecQTuDwse3exdYvmx9m8ndi+Slk2U3qla6CuDGmgnAn7GaDktljEtudprjB qD0jRgWvNq9O5tkrd242Hu0nn4DgSYI9wUy2j1CcloZizUveL3VX/gvnzeErcUVebTyr yraQ== X-Gm-Message-State: AKGB3mKDIjOM9AxMFOh12skS790dB7C1TPPuWY5DvhZ4bisLXzfIUk/G hUiAoptWyh8Y3Wlrgz+tpQBo5w== X-Google-Smtp-Source: ACJfBotX2pXpmch5tS7M8uVzHcCzyxdcQsmt9wkXIj3/EwKZLN9MaQx7xtOtSfEgNJyiBB+pqGnjBw== X-Received: by 10.80.208.26 with SMTP id j26mr59125729edf.109.1514833689149; Mon, 01 Jan 2018 11:08:09 -0800 (PST) Received: from localhost.localdomain (D4CCACC7.cm-2.dynamic.ziggo.nl. [212.204.172.199]) by smtp.gmail.com with ESMTPSA id v15sm33236633edb.41.2018.01.01.11.08.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jan 2018 11:08:08 -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 v2 04/34] clk: omap2: change omap2_round_to_table_rate return logic Date: Mon, 1 Jan 2018 19:07:31 +0000 Message-Id: <1514833681-30737-5-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514833681-30737-1-git-send-email-pure.logic@nexus-software.ie> References: <1514833681-30737-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_110821_264100_35D09CDD X-CRM114-Status: GOOD ( 12.30 ) 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: Tony Lindgren , Bryan O'Donoghue , linux-omap@vger.kernel.org, Russell King , 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: Tony Lindgren Cc: Russell King Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index e024600..ce3a33f 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -75,9 +75,9 @@ unsigned long omap2_round_to_table_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { const struct prcm_config *ptr; - long highest_rate; + unsigned long highest_rate; - highest_rate = -EINVAL; + highest_rate = 0; for (ptr = rate_table; ptr->mpu_speed; ptr++) { if (!(ptr->flags & cpu_mask))