From patchwork Thu Sep 28 17:50:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Sahu X-Patchwork-Id: 9976583 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 1881160365 for ; Thu, 28 Sep 2017 17:55:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09DE32766D for ; Thu, 28 Sep 2017 17:55:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0729296D5; Thu, 28 Sep 2017 17:55:10 +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_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 7F7742766D for ; Thu, 28 Sep 2017 17:55:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752190AbdI1Ry4 (ORCPT ); Thu, 28 Sep 2017 13:54:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:50310 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752405AbdI1RvH (ORCPT ); Thu, 28 Sep 2017 13:51:07 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 57A9D60B74; Thu, 28 Sep 2017 17:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1506621067; bh=LMNhEOcUgeNQrur50MwblOj4MjTQzoUMgcdvpr6mS3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rg//+9Lynne51/+lDVIAjcB5cdqsYwNcZakH0yP6m5B5mimd7Yl0UJ4qfdoPev+ZU ohW11VU4/jyq8oGJRjDiCwOoKRAzFsfc7J0i7YXINIRBQ6OdtIqPMQd5la0/jPLKMB oYOBAHI+VPvFRnvaMkVWPHyerO2TBUlMvgElZ8jQ= Received: from absahu-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: absahu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D6E5E60AD5; Thu, 28 Sep 2017 17:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1506621066; bh=LMNhEOcUgeNQrur50MwblOj4MjTQzoUMgcdvpr6mS3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZvHaXw3y4f2vgkix91QlEpU/tuVGw7I2/OcMazIBoEYl6GdlF3cYCIbBLl1r2vm/y LEB7OepzMELHNJZM8P3bsLsvxCJeqI1U3aTwIXJZq6aFrF7YMKmKjRWxaanzPWnlbO 7v1gTNFHzNt1tBBeSR0AwTRv1QiA83jN+vIb4/NA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D6E5E60AD5 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=absahu@codeaurora.org From: Abhishek Sahu To: Stephen Boyd , Michael Turquette Cc: Andy Gross , David Brown , Rajendra Nayak , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Abhishek Sahu Subject: [PATCH 02/13] clk: qcom: minor code reorganization related with offset variable Date: Thu, 28 Sep 2017 23:20:39 +0530 Message-Id: <1506621050-10129-3-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506621050-10129-1-git-send-email-absahu@codeaurora.org> References: <1506621050-10129-1-git-send-email-absahu@codeaurora.org> 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 This patch does minor code reorganization related with offset variable assignment. The offset variable can be directly defined which will help in subsequent patches to support different PLL offset registers. Signed-off-by: Abhishek Sahu --- drivers/clk/qcom/clk-alpha-pll.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c index b9be822..ab2f23c 100644 --- a/drivers/clk/qcom/clk-alpha-pll.c +++ b/drivers/clk/qcom/clk-alpha-pll.c @@ -70,12 +70,11 @@ static int wait_for_pll(struct clk_alpha_pll *pll, u32 mask, bool inverse, const char *action) { - u32 val, off; + u32 val, off = pll->offset; int count; int ret; const char *name = clk_hw_get_name(&pll->clkr.hw); - off = pll->offset; ret = regmap_read(pll->clkr.regmap, off, &val); if (ret) return ret; @@ -143,11 +142,10 @@ void clk_alpha_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap, static int clk_alpha_pll_hwfsm_enable(struct clk_hw *hw) { - int ret; - u32 val, off; struct clk_alpha_pll *pll = to_clk_alpha_pll(hw); + int ret; + u32 val, off = pll->offset; - off = pll->offset; ret = regmap_read(pll->clkr.regmap, off, &val); if (ret) return ret; @@ -169,11 +167,10 @@ static int clk_alpha_pll_hwfsm_enable(struct clk_hw *hw) static void clk_alpha_pll_hwfsm_disable(struct clk_hw *hw) { - int ret; - u32 val, off; struct clk_alpha_pll *pll = to_clk_alpha_pll(hw); + int ret; + u32 val, off = pll->offset; - off = pll->offset; ret = regmap_read(pll->clkr.regmap, off, &val); if (ret) return; @@ -200,11 +197,10 @@ static void clk_alpha_pll_hwfsm_disable(struct clk_hw *hw) static int pll_is_enabled(struct clk_hw *hw, u32 mask) { - int ret; - u32 val, off; struct clk_alpha_pll *pll = to_clk_alpha_pll(hw); + int ret; + u32 val, off = pll->offset; - off = pll->offset; ret = regmap_read(pll->clkr.regmap, off, &val); if (ret) return ret; @@ -226,9 +222,7 @@ static int clk_alpha_pll_enable(struct clk_hw *hw) { int ret; struct clk_alpha_pll *pll = to_clk_alpha_pll(hw); - u32 val, mask, off; - - off = pll->offset; + u32 val, mask, off = pll->offset; mask = PLL_OUTCTRL | PLL_RESET_N | PLL_BYPASSNL; ret = regmap_read(pll->clkr.regmap, off, &val); @@ -280,9 +274,7 @@ static void clk_alpha_pll_disable(struct clk_hw *hw) { int ret; struct clk_alpha_pll *pll = to_clk_alpha_pll(hw); - u32 val, mask, off; - - off = pll->offset; + u32 val, mask, off = pll->offset; ret = regmap_read(pll->clkr.regmap, off, &val); if (ret)