From patchwork Fri Aug 12 10:51:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keguang Zhang X-Patchwork-Id: 9276715 X-Patchwork-Delegate: sboyd@codeaurora.org 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 313CD60CDC for ; Fri, 12 Aug 2016 10:52:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 218212897A for ; Fri, 12 Aug 2016 10:52:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 155F92897F; Fri, 12 Aug 2016 10:52:41 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A45EB28979 for ; Fri, 12 Aug 2016 10:52:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752654AbcHLKwU (ORCPT ); Fri, 12 Aug 2016 06:52:20 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36177 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752432AbcHLKwT (ORCPT ); Fri, 12 Aug 2016 06:52:19 -0400 Received: by mail-pf0-f196.google.com with SMTP id y134so1377152pfg.3; Fri, 12 Aug 2016 03:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=skjjA/cDkM7BtWu5ygE35Wbq8oqFXWrVZBzu865+Vqk=; b=0uMIbLmPHyU+HV1U2f+mObrllbAIh1XmFIzdLEfwRDBRmhDuzpcwqUohApP1T6iaee meqy8mQpRz2VZR9o8G2rWMh6dn0YptQloQW4X3KZZ8lEDn/iBSfLa0aIriNAIiSFV+iX zUiq17pCnunPmlFzVrS4g0s5EL6WybZ/gmiAOiTSW2pJhiLyXgPFPA9zO4Wxi+6t87BY 0F4XJvEDiI0AzlAKwgn9cXopibLWaQDrblDYv44vS/I4zHvr+gCwYR8ypQR989+LRrY/ RscyXVzP/QbPSTdP35xMtgSk9l2COw6VkgtiqE30LosR9NzG+86nIjdjDLD04XEazacO w4UA== 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=skjjA/cDkM7BtWu5ygE35Wbq8oqFXWrVZBzu865+Vqk=; b=jWsoZbhqIPpMqzez57t5M2CSaf58xV9a2tZol+uoGLoi0oGsxbMUaphzLgnbnM2F5T viMhwkWoj7UUfKnVbB32zUI0jQYDalMzKzLfLYv2/EKs0U6jm6M1DPjodMFpwkG5GUAV aDncsddgOGyr9hAhSLRJDQV4gktsF+C7mKSA6eKW6tg8Y7Vp9djbowoYADgoIgFE8mcc XdP5ulFlTbWW8cfOxJtG6NC2eErFCzVSkOwbuoz/tdB9uTmaJixe5Pm9a2f4Fr8ZaFcY yOL0qL8iIwKlzEX6WK3xEUybG2xgX1SspSihxFpapX6lUSyPXi6FbpAoGx3nMVbOX41B pVPQ== X-Gm-Message-State: AEkoousnOr51qJkVmWcCE4Rfp/vn+5nNA7J7ex0nbyxrllIW86p3ojUzB7fXFu8b9TLKYg== X-Received: by 10.98.60.217 with SMTP id b86mr25975419pfk.129.1470999138525; Fri, 12 Aug 2016 03:52:18 -0700 (PDT) Received: from localhost.localdomain ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id k78sm12034940pfa.78.2016.08.12.03.52.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Aug 2016 03:52:17 -0700 (PDT) From: Keguang Zhang To: linux-clk@vger.kernel.org, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Cc: Michael Turquette , Stephen Boyd , Kelvin Cheung Subject: [PATCH 3/3] clk: Loongson1: Make use of GENMASK Date: Fri, 12 Aug 2016 18:51:48 +0800 Message-Id: <1470999108-9851-4-git-send-email-keguang.zhang@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470999108-9851-1-git-send-email-keguang.zhang@gmail.com> References: <1470999108-9851-1-git-send-email-keguang.zhang@gmail.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kelvin Cheung Make use of GENMASK instead of open coding the equivalent operation, and update the PLL formula. Signed-off-by: Kelvin Cheung --- drivers/clk/loongson1/clk-loongson1b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/loongson1/clk-loongson1b.c b/drivers/clk/loongson1/clk-loongson1b.c index 2302ee5..5cedb28 100644 --- a/drivers/clk/loongson1/clk-loongson1b.c +++ b/drivers/clk/loongson1/clk-loongson1b.c @@ -26,7 +26,7 @@ static unsigned long ls1x_pll_recalc_rate(struct clk_hw *hw, u32 pll, rate; pll = __raw_readl(LS1X_CLK_PLL_FREQ); - rate = 12 + (pll & 0x3f) + (((pll >> 8) & 0x3ff) >> 10); + rate = 12 + (pll & GENMASK(5, 0)); rate *= OSC; rate >>= 1;