Message ID | 20180118184532.6856-5-jbrunet@baylibre.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org> 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 272C1601E7 for <patchwork-linux-amlogic@patchwork.kernel.org>; Thu, 18 Jan 2018 18:46:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1748228437 for <patchwork-linux-amlogic@patchwork.kernel.org>; Thu, 18 Jan 2018 18:46:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C33628445; Thu, 18 Jan 2018 18:46:13 +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 B9D6A28437 for <patchwork-linux-amlogic@patchwork.kernel.org>; Thu, 18 Jan 2018 18:46:12 +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=KXR92u7w2Q5ndb6X2dhAzgy0U7SKkcOdEzzEDu066MI=; b=IyFTFDs5joz3f/EjCxT20eATGr mlRH9FNREWk2xAUfCDRz+Zna9Lrq0g2+7DUNcBDyHuRDRLZNtiMSCNDxVmm/fIiKpW+vHZY0SG7TB CDzPfTnvfZdGlOHpIGX1E4jWdIhDAe1UAoYY+3SJmLNMCs6DKtIbgpPae3OTEXGXKm6wXRjuR2603 cDlN7ub4RHbuRN3NoIo6sEyu6Du72THlC7uf2COJB+OcUvYJETcLyPNwg3s8Q7x5R/SMdjA4/KGua UrTQVsaoCQ+9sLH3IpneJe0MNcr7DgIwpVslor/qOGftOuinf7jHFbZ3V69Ov/M+g2XXrZMvUfS6a +sbCC4BQ==; 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 1ecFCL-0003mP-Vg; Thu, 18 Jan 2018 18:46:02 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ecFCA-0003b3-Qw for linux-amlogic@lists.infradead.org; Thu, 18 Jan 2018 18:45:53 +0000 Received: by mail-wm0-x242.google.com with SMTP id i11so24784444wmf.4 for <linux-amlogic@lists.infradead.org>; Thu, 18 Jan 2018 10:45:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+XIrCgDt5NBe08Q927BYRS4towZAMgpTkx6cXoR4EhI=; b=qXG1kbzOal5r+PxBXz2LwlbpFPBhILf/LkcGK+9vDkI1usqejM0jhIKSWtD7jkEnIR z7O3zdHPTpgEM8pZ82PNz0hjzaK9X0yKm21i8LhXZ2/JSmJIINt5ltWu9+k7Y2Vni6Hx KloSG365KMUlnnZpE7HIRordpHaQyrOvN89enwmw/L4z77q8KKcL6UnEMsgzOamfs+Ur IYbKtuMXokEWEQnhRYvpEymzchtJ8BuZ7na3jJI6Ru+9UlSkXvBByLgmBK4XQ11133Y0 BrcCyAG4gTIS9mbdHy6VnJt/g6eWb9VB5WAmJOt5PEOBgZY+5V7UPOSZ9/KnYWDHk48T X4UQ== 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=+XIrCgDt5NBe08Q927BYRS4towZAMgpTkx6cXoR4EhI=; b=AyXy1WsrOgFTRSyvjXOLOhGa0kXv4hDiivCqALOn6WAXKKQnQKmvhew7w1q4jqp7Je gdOaTvlhaD8LR7F+oXss87zLrQm1wKA7wDwCpD1pNig3be7LIXVBDXp09Ngy6u/XVIiP wWSNFEvzwLYEsuudg0VSuSYu+/p1hzIYSAhWjhmxTRFfOUMkGUdoDQQHssmUy5rmE7b7 L6zlWNJvFGmtZBG0CEM9lthgGbXR2GRaXC+epUpFqYqd2y8aAgOnjd2wAFZAh6tjH3mJ 89dH4oBPLLTxdaBklBS87SgblpGkYwcgvjmkeG4Ixh5eNutCvRQOSFVgJDsB9oy1P4UF tNHw== X-Gm-Message-State: AKwxytfduai3akiB/YjJzlIC4xeJiWa8UaEq+mQYccKtRJsLXISGNTbO NVd2173cgWbexP0PtkqBsgx7rQ== X-Google-Smtp-Source: ACJfBouGa3m/s2Edd9cIZTZ0iR7INFcMVxAKRuT12IGGZ4uATakjq5YdL2TVMUdHZj1gm13qFWkD2w== X-Received: by 10.28.140.9 with SMTP id o9mr2610060wmd.28.1516301138915; Thu, 18 Jan 2018 10:45:38 -0800 (PST) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id y62sm6240236wrb.48.2018.01.18.10.45.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jan 2018 10:45:38 -0800 (PST) From: Jerome Brunet <jbrunet@baylibre.com> To: Neil Armstrong <narmstrong@baylibre.com> Subject: [PATCH 4/9] clk: meson: use frac parameter width instead of a constant Date: Thu, 18 Jan 2018 19:45:27 +0100 Message-Id: <20180118184532.6856-5-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180118184532.6856-1-jbrunet@baylibre.com> References: <20180118184532.6856-1-jbrunet@baylibre.com> X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-amlogic.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-amlogic>, <mailto:linux-amlogic-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-amlogic/> List-Post: <mailto:linux-amlogic@lists.infradead.org> List-Help: <mailto:linux-amlogic-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-amlogic>, <mailto:linux-amlogic-request@lists.infradead.org?subject=subscribe> Cc: Kevin Hilman <khilman@baylibre.com>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@codeaurora.org>, linux-kernel@vger.kernel.org, Carlo Caione <carlo@caione.org>, linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, Jerome Brunet <jbrunet@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" <linux-amlogic-bounces@lists.infradead.org> Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index fa4cec13d6e8..d9efe725b7ad 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -80,7 +80,7 @@ static unsigned long meson_clk_pll_recalc_rate(struct clk_hw *hw, reg = readl(pll->base + p->reg_off); frac = PARM_GET(p->width, p->shift, reg); - rate += (u64)parent_rate * frac >> 12; + rate += (u64)parent_rate * frac >> p->width; rate *= 2; }
Use the fractional part width in the calculation instead of 12, which happens to e the witdh right now. This is safer in case the field width ever change in the future Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> --- drivers/clk/meson/clk-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)