From patchwork Fri Dec 27 00:44:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Bresticker X-Patchwork-Id: 3407871 Return-Path: X-Original-To: patchwork-linux-arm@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 A01389F380 for ; Fri, 27 Dec 2013 01:12:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E3CFC2013A for ; Fri, 27 Dec 2013 01:12:45 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C68722012B for ; Fri, 27 Dec 2013 01:12:44 +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 1VwLZw-0004sl-4H; Fri, 27 Dec 2013 00:47:05 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VwLZ8-0000Ad-FR; Fri, 27 Dec 2013 00:46:14 +0000 Received: from mail-ig0-f201.google.com ([209.85.213.201]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VwLYC-0008Uh-H5 for linux-arm-kernel@lists.infradead.org; Fri, 27 Dec 2013 00:45:16 +0000 Received: by mail-ig0-f201.google.com with SMTP id hk11so2055634igb.0 for ; Thu, 26 Dec 2013 16:44:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BRHatSyaQZHTyOclBF6i9sWdTMpyZbhdcpOIl1yVV4c=; b=D4TnwlJgjCCeUmk5YQvNdv/FJcmTGvD2hAacpKpTjb9uOpEnI5SdnMBkvitYEN45d8 zO7VZBJZNlukroSxfkBzM2/VLiXXaiPGuHsclX8iyoKdyQ0SDeeHcELqpOmduY2PBm4o rohwk06lp1uBdfOYu59CuAO2X/R3t+17UKwirXVtEOsSk4O//KSjlH6U4ccYx/xes0h2 VSBsXB8pUyfvw8fSDIDIhZk5HS9QYLk6EMhH/kL9IvijATU9Popmxnwaha7CPIZoiXMe pYIRi9qYopt+WD4eeaK2kE1trWUsw1LrKxvbPC4DloX2SZMX/Y5l/76aADg45e9zde/2 9Llg== X-Gm-Message-State: ALoCoQmLWLI4Ln4T4bWDkLakX3FWtRLD9bnUMklKHfsEBjYxl3Ic+j+G3pVD+t6nJsmaqnOPKW08LZ0lPDINxGdDIojDy9m3kGtCa1FnXO7ri1/bQsfNswWknxRMiJNCzosRRsMDs4aeaJakyZO7K/THLSAqc/zSQyZ4xi3WzTJtujdpcLbagGyHpEa7jlzp6D4sq9090WKeoa2Ep1TK67Cw8r0jyrC7uQ== X-Received: by 10.182.29.196 with SMTP id m4mr11178232obh.26.1388105093324; Thu, 26 Dec 2013 16:44:53 -0800 (PST) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id k45si10141709yhn.4.2013.12.26.16.44.53 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Dec 2013 16:44:53 -0800 (PST) Received: from abrestic.mtv.corp.google.com (abrestic.mtv.corp.google.com [172.22.72.111]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 2183031C107; Thu, 26 Dec 2013 16:44:53 -0800 (PST) Received: by abrestic.mtv.corp.google.com (Postfix, from userid 137652) id D7B58220798; Thu, 26 Dec 2013 16:44:52 -0800 (PST) From: Andrew Bresticker To: Mike Turquette , Stephen Warren Subject: [PATCH 7/7] clk: tegra: use max divider if divider overflows Date: Thu, 26 Dec 2013 16:44:27 -0800 Message-Id: <1388105067-24438-8-git-send-email-abrestic@chromium.org> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1388105067-24438-1-git-send-email-abrestic@chromium.org> References: <1388105067-24438-1-git-send-email-abrestic@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131226_194516_586303_720B338D X-CRM114-Status: UNSURE ( 9.67 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -3.2 (---) Cc: Prashant Gaikwad , Andrew Bresticker , Peter De Schrijver , linux-kernel@vger.kernel.org, Thierry Reding , linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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: , MIME-Version: 1.0 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.8 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 When requesting a rate less than the minimum clock rate for a divider, use the maximum divider value instead of bailing out with an error. This matches the behavior of the generic clock divider. Signed-off-by: Andrew Bresticker --- drivers/clk/tegra/clk-divider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/tegra/clk-divider.c b/drivers/clk/tegra/clk-divider.c index 4d75b1f..290f9c1 100644 --- a/drivers/clk/tegra/clk-divider.c +++ b/drivers/clk/tegra/clk-divider.c @@ -59,7 +59,7 @@ static int get_div(struct tegra_clk_frac_div *divider, unsigned long rate, return 0; if (divider_ux1 > get_max_div(divider)) - return -EINVAL; + return get_max_div(divider); return divider_ux1; }