Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp401453ybl; Wed, 11 Dec 2019 01:28:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxVEj3WF+ycQRMcZ2sYQV0IA+97Sv9ct5GSla50Vi4ybw76ctdChRk3PX0Uk62MzvJ3Mc1I X-Received: by 2002:aca:4e90:: with SMTP id c138mr2027995oib.147.1576056527885; Wed, 11 Dec 2019 01:28:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576056527; cv=none; d=google.com; s=arc-20160816; b=D9qoSZ/vF43nclV9b7V7h86yBOZdJWhN0ouXlUjl8qNyj5bCnoT7LQWZ4R+hKPn8j0 RYh/tjqbhNB+UX9O0vLFxiBXoCpTcN6+tIlzV2QynY4LJliHktreB44SKuWrlnNzz7gV PghW9PzfYZVx6tji1sNQEDgCXXayAzBRFYUIOh3+NffyaPlB1ENNLRnqx2MJbuxfk93K 6F6vPlkDo1zeo0OgbMaBjDKNU8SXgyoA4gz7aSILJFR96SPE/H0gbwhv9IsWaDkbN3Pb yZJ50hDsfDpzFgPLz54lpQfAfp4cNqBFAui/9lJF6cF9nXAxX437uiosqdNROFaTD5rt HTeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=o3I9UHiEET0CmklQeRcknx9bHnHrAXkJt5+MDYnXm8w=; b=EdJbk8Jq8nTXmp0sa4IoPubtVS3jGJs7sG5iiSu645VEhqwif3qI8/gVDcXr8lhzUY tzEM/p8JsP7iXs90tP/Kt6cdAlTDRg5LcJOEZTPePAQH2VWb+gHRGXADxFUk7npq+Rpm DYNfmSvcHyo0QRpasXBlyTg9t5x0is7XTA0K9/lC81VU0JDtbs4KKkxBaB74yOhxVAFC JUB9rGaYjn0F8EY/8zUQLh06z54v4v4Nc9pFLNbNNQBUZK718Gqa5OO6SkD11AHtAOnJ l8m+wiGBT31IF8HvfHFl5SZSPtO0IMmd/iMjXsR1cCdbXHeXVr2P5Hj0fInCi+L8eD2p scCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o2si812938oig.41.2019.12.11.01.28.36; Wed, 11 Dec 2019 01:28:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728626AbfLKJ0k (ORCPT + 99 others); Wed, 11 Dec 2019 04:26:40 -0500 Received: from inva020.nxp.com ([92.121.34.13]:49664 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726983AbfLKJ0G (ORCPT ); Wed, 11 Dec 2019 04:26:06 -0500 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5C8A71A0C2F; Wed, 11 Dec 2019 10:26:04 +0100 (CET) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5019D1A0C29; Wed, 11 Dec 2019 10:26:04 +0100 (CET) Received: from fsr-ub1664-175.ea.freescale.net (fsr-ub1664-175.ea.freescale.net [10.171.82.40]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id CD4B420568; Wed, 11 Dec 2019 10:26:03 +0100 (CET) From: Abel Vesa To: Shawn Guo , Stephen Boyd , Sascha Hauer Cc: Dong Aisheng , NXP Linux Team , Peng Fan , Linux Kernel Mailing List , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Leonard Crestez , Jacky Bai , Abel Vesa Subject: [RESEND v2 04/11] clk: imx: pllv1: Switch to clk_hw based API Date: Wed, 11 Dec 2019 11:25:43 +0200 Message-Id: <1576056350-20715-5-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1576056350-20715-1-git-send-email-abel.vesa@nxp.com> References: <1576056350-20715-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch the imx_clk_pllv1 register function to clk_hw based API, rename accordingly and add a macro for clk based legacy. This allows us to move closer to a clear split between consumer and provider clk APIs. Signed-off-by: Abel Vesa Reviewed-by: Peng Fan --- drivers/clk/imx/clk-pllv1.c | 14 +++++++++----- drivers/clk/imx/clk.h | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/clk/imx/clk-pllv1.c b/drivers/clk/imx/clk-pllv1.c index 4ba9973..de4f8a4 100644 --- a/drivers/clk/imx/clk-pllv1.c +++ b/drivers/clk/imx/clk-pllv1.c @@ -111,12 +111,13 @@ static const struct clk_ops clk_pllv1_ops = { .recalc_rate = clk_pllv1_recalc_rate, }; -struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, +struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name, const char *parent, void __iomem *base) { struct clk_pllv1 *pll; - struct clk *clk; + struct clk_hw *hw; struct clk_init_data init; + int ret; pll = kmalloc(sizeof(*pll), GFP_KERNEL); if (!pll) @@ -132,10 +133,13 @@ struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, init.num_parents = 1; pll->hw.init = &init; + hw = &pll->hw; - clk = clk_register(NULL, &pll->hw); - if (IS_ERR(clk)) + ret = clk_hw_register(NULL, hw); + if (ret) { kfree(pll); + return ERR_PTR(ret); + } - return clk; + return hw; } diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 62b7c14..9dd5ea5 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -110,10 +110,13 @@ extern struct imx_pll14xx_clk imx_1443x_dram_pll; #define imx_clk_mux(name, reg, shift, width, parents, num_parents) \ to_clk(imx_clk_hw_mux(name, reg, shift, width, parents, num_parents)) +#define imx_clk_pllv1(type, name, parent, base) \ + to_clk(imx_clk_hw_pllv1(type, name, parent, base)) + struct clk *imx_clk_pll14xx(const char *name, const char *parent_name, void __iomem *base, const struct imx_pll14xx_clk *pll_clk); -struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, +struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name, const char *parent, void __iomem *base); struct clk *imx_clk_pllv2(const char *name, const char *parent, -- 2.7.4