Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1284065

[PATCH v3 06/13] clk: at91: pmc: merge at91_pmc_init in atmel_pmc_probe

From Alexandre Belloni <alexandre.belloni@free-electrons.com>
Newsgroups linux.kernel
Subject [PATCH v3 06/13] clk: at91: pmc: merge at91_pmc_init in atmel_pmc_probe
Date 2015-12-04 18:20 +0100
Message-ID <qC2bx-5CT-29@gated-at.bofh.it> (permalink)
References <qC21Q-5zk-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


at91_pmc_init() doesn't do much anymore, merge it in atmel_pmc_probe().

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/clk/at91/pmc.c | 31 ++++++-------------------------
 1 file changed, 6 insertions(+), 25 deletions(-)

diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
index 2f8b9503176f..55ed00fc9310 100644
--- a/drivers/clk/at91/pmc.c
+++ b/drivers/clk/at91/pmc.c
@@ -231,29 +231,6 @@ static const struct at91_pmc_caps sama5d3_caps = {
 			  AT91_PMC_CFDEV,
 };
 
-static struct at91_pmc *__init at91_pmc_init(struct device_node *np,
-					     struct regmap *regmap,
-					     void __iomem *regbase, int virq,
-					     const struct at91_pmc_caps *caps)
-{
-	struct at91_pmc *pmc;
-
-	if (!regbase || !virq ||  !caps)
-		return NULL;
-
-	at91_pmc_base = regbase;
-
-	pmc = kzalloc(sizeof(*pmc), GFP_KERNEL);
-	if (!pmc)
-		return NULL;
-
-	pmc->regmap = regmap;
-	pmc->virq = virq;
-	pmc->caps = caps;
-
-	return pmc;
-}
-
 static const struct of_device_id atmel_pmc_dt_ids[] = {
 	{ .compatible = "atmel,at91rm9200-pmc", .data = &at91rm9200_caps },
 	{ .compatible = "atmel,at91sam9260-pmc", .data = &at91sam9260_caps },
@@ -271,11 +248,12 @@ static int __init atmel_pmc_probe(struct platform_device *pdev)
 	const struct at91_pmc_caps *caps;
 	struct device_node *np = pdev->dev.of_node;
 	struct at91_pmc *pmc;
-	void __iomem *regbase = of_iomap(np, 0);
 	struct regmap *regmap;
 	int virq;
 	int ret = 0;
 
+	at91_pmc_base = of_iomap(np, 0);
+
 	regmap = syscon_node_to_regmap(np);
 	if (IS_ERR(regmap))
 		panic("Could not retrieve syscon regmap");
@@ -287,10 +265,13 @@ static int __init atmel_pmc_probe(struct platform_device *pdev)
 	of_id = of_match_device(atmel_pmc_dt_ids, &pdev->dev);
 	caps = of_id->data;
 
-	pmc = at91_pmc_init(np, regmap, regbase, virq, caps);
+	pmc = kzalloc(sizeof(*pmc), GFP_KERNEL);
 	if (!pmc)
 		return 0;
 
+	pmc->regmap = regmap;
+	pmc->virq = virq;
+	pmc->caps = caps;
 	pmc->irqdomain = irq_domain_add_linear(pdev->dev.of_node, 32,
 					       &pmc_irq_ops, pmc);
 	if (!pmc->irqdomain)
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 00/13] ARM: at91: PMC driver rework Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:10 +0100
  [PATCH v3 10/13] ARM: at91: pm: move idle functions to pm.c Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:10 +0100
  [PATCH v3 01/13] clk: at91: make use of syscon to share PMC registers in several drivers Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:10 +0100
  [PATCH v3 12/13] usb: gadget: atmel: access the PMC using regmap Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:10 +0100
  [PATCH v3 09/13] ARM: at91: pm: find and remap the pmc Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:10 +0100
  [PATCH v3 07/13] clk: at91: pmc: move pmc structures to C file Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:10 +0100
  [PATCH v3 08/13] ARM: at91: pm: simply call at91_pm_init Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:10 +0100
  [PATCH v3 13/13] clk: at91: pmc: drop at91_pmc_base Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:10 +0100
  [PATCH v3 11/13] ARM: at91: remove useless includes and function prototypes Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:10 +0100
  [PATCH v3 04/13] clk: at91: make IRQ optional and register them later Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:20 +0100
  [PATCH v3 03/13] clk: at91: clk-main: factorize irq handling Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:20 +0100
  [PATCH v3 06/13] clk: at91: pmc: merge at91_pmc_init in atmel_pmc_probe Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:20 +0100
  [PATCH v3 05/13] clk: at91: only disable available IRQs Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-04 18:20 +0100
  Re: [PATCH v3 00/13] ARM: at91: PMC driver rework Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-10 18:10 +0100

csiph-web