From patchwork Thu Feb 13 16:19:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11380771 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9193192A for ; Thu, 13 Feb 2020 16:20:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 711642073C for ; Thu, 13 Feb 2020 16:20:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="FEVZc9jp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728824AbgBMQUL (ORCPT ); Thu, 13 Feb 2020 11:20:11 -0500 Received: from outils.crapouillou.net ([89.234.176.41]:55868 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727675AbgBMQUK (ORCPT ); Thu, 13 Feb 2020 11:20:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1581610805; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g/SD8x/sT6sRYFTDMcohhadfbdGohJWYMNwnI87CBaA=; b=FEVZc9jp99cvjMkDmWCd6R69TaBlRm5xzSiXDMEkp1TXh5G2jVFNy8oIN5up2Aoa6fJfXb QrKuk638Vs/l0bJy9ljUKOiLLmurymKxwgL/9HHZd3Cd4BrQlPREluKmkZ9fHO6y+7eYoC loWqVBCUNjD1lx9xIyz+A+rKILgkzJI= From: Paul Cercueil To: Michael Turquette , Stephen Boyd Cc: od@zcrc.me, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , stable@vger.kernel.org Subject: [PATCH v2 2/2] clk: ingenic/TCU: Fix round_rate returning error Date: Thu, 13 Feb 2020 13:19:52 -0300 Message-Id: <20200213161952.37460-2-paul@crapouillou.net> In-Reply-To: <20200213161952.37460-1-paul@crapouillou.net> References: <20200213161952.37460-1-paul@crapouillou.net> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org When requesting a rate superior to the parent's rate, it would return -EINVAL instead of simply returning the parent's rate like it should. Fixes: 4f89e4b8f121 ("clk: ingenic: Add driver for the TCU clocks") Cc: stable@vger.kernel.org Signed-off-by: Paul Cercueil --- Notes: v2: New patch drivers/clk/ingenic/tcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/ingenic/tcu.c b/drivers/clk/ingenic/tcu.c index ad7daa494fd4..cd537c3db782 100644 --- a/drivers/clk/ingenic/tcu.c +++ b/drivers/clk/ingenic/tcu.c @@ -189,7 +189,7 @@ static long ingenic_tcu_round_rate(struct clk_hw *hw, unsigned long req_rate, u8 prescale; if (req_rate > rate) - return -EINVAL; + return rate; prescale = ingenic_tcu_get_prescale(rate, req_rate);