From patchwork Sat May 16 00:23:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 6418551 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 30DDFC0432 for ; Sat, 16 May 2015 00:29:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5318F20570 for ; Sat, 16 May 2015 00:29:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6346A20567 for ; Sat, 16 May 2015 00:29:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YtPw8-0008TY-LW; Sat, 16 May 2015 00:26:40 +0000 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YtPtn-0006Do-Dn for linux-arm-kernel@lists.infradead.org; Sat, 16 May 2015 00:24:20 +0000 Received: by wicnf17 with SMTP id nf17so8176090wic.1 for ; Fri, 15 May 2015 17:23:53 -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=XGWsABtPn2pLVhMdD65bgXfpN3ZUzSiYyxE4+rMthtw=; b=wSgVg635UfjbhDOF3+BeTvDiwDCHXgOCfU+WcfIBgcSiC0nx2NAk/Gl3xnk4o5XJBs HxAoBvo8xv94ba5x/q+2za09Jo9Wee6xJx1TZpxXGLm4oUbTW9I3aCH7E1p5zY4Sb84D NU9ojE1mLEtWSva9kWV20hDDyeKadGig6snz6MmGPSv/3+ZRiFu/FesGrAkXj0PZBx84 5/+WVfzgxQ/utG6cf2iKZhqBZ/MOT1ccq/VbwNOKtW+Nyuvag6PXg+w5wF+1jjGGA1jm dTzQg0TMqjhHI6/cAHYB0AeKBa5m7sz/STqgRmh3yD807NfP2+YmPexYz1emrotxUdpf F2kg== X-Received: by 10.194.120.68 with SMTP id la4mr22796124wjb.139.1431735833401; Fri, 15 May 2015 17:23:53 -0700 (PDT) Received: from topkick.lan (x5ce62600.dyn.telefonica.de. [92.230.38.0]) by mx.google.com with ESMTPSA id ng5sm406995wic.24.2015.05.15.17.23.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 May 2015 17:23:52 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH 05/14] reset: berlin: drop arch_initcall initialization Date: Sat, 16 May 2015 02:23:34 +0200 Message-Id: <1431735823-28006-6-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1431735823-28006-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1431735823-28006-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150515_172415_635218_AAE459D4 X-CRM114-Status: GOOD ( 11.85 ) X-Spam-Score: -0.8 (/) Cc: Philipp Zabel , Antoine Ternart , linux-arm-kernel@lists.infradead.org, Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Antoine Tenart With proper platform driver probing for berlin reset driver, drop the arch_initcall workaround. Signed-off-by: Antoine Tenart Acked-by: Philipp Zabel Signed-off-by: Sebastian Hesselbarth --- Cc: Philipp Zabel --- drivers/reset/reset-berlin.c | 71 +------------------------------------------- 1 file changed, 1 insertion(+), 70 deletions(-) diff --git a/drivers/reset/reset-berlin.c b/drivers/reset/reset-berlin.c index d43bc163dd02..3c922d37255c 100644 --- a/drivers/reset/reset-berlin.c +++ b/drivers/reset/reset-berlin.c @@ -27,8 +27,6 @@ container_of((p), struct berlin_reset_priv, rcdev) struct berlin_reset_priv { - void __iomem *base; - unsigned int size; struct regmap *regmap; struct reset_controller_dev rcdev; }; @@ -40,10 +38,7 @@ static int berlin_reset_reset(struct reset_controller_dev *rcdev, int offset = id >> 8; int mask = BIT(id & 0x1f); - if (priv->regmap) - regmap_write(priv->regmap, offset, mask); - else - writel(mask, priv->base + offset); + regmap_write(priv->regmap, offset, mask); /* let the reset be effective */ udelay(10); @@ -58,7 +53,6 @@ static struct reset_control_ops berlin_reset_ops = { static int berlin_reset_xlate(struct reset_controller_dev *rcdev, const struct of_phandle_args *reset_spec) { - struct berlin_reset_priv *priv = to_berlin_reset_priv(rcdev); unsigned offset, bit; if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells)) @@ -67,9 +61,6 @@ static int berlin_reset_xlate(struct reset_controller_dev *rcdev, offset = reset_spec->args[0]; bit = reset_spec->args[1]; - if (offset >= priv->size) - return -EINVAL; - if (bit >= BERLIN_MAX_RESETS) return -EINVAL; @@ -120,63 +111,3 @@ MODULE_AUTHOR("Antoine Tenart "); MODULE_AUTHOR("Sebastian Hesselbarth "); MODULE_DESCRIPTION("Marvell Berlin reset driver"); MODULE_LICENSE("GPL"); - -static int __berlin_reset_init(struct device_node *np) -{ - struct berlin_reset_priv *priv; - struct resource res; - resource_size_t size; - int ret; - - priv = kzalloc(sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; - - ret = of_address_to_resource(np, 0, &res); - if (ret) - goto err; - - size = resource_size(&res); - priv->base = ioremap(res.start, size); - if (!priv->base) { - ret = -ENOMEM; - goto err; - } - priv->size = size; - - priv->rcdev.owner = THIS_MODULE; - priv->rcdev.ops = &berlin_reset_ops; - priv->rcdev.of_node = np; - priv->rcdev.of_reset_n_cells = 2; - priv->rcdev.of_xlate = berlin_reset_xlate; - - reset_controller_register(&priv->rcdev); - - return 0; - -err: - kfree(priv); - return ret; -} - -static const struct of_device_id berlin_reset_of_match[] __initconst = { - { .compatible = "marvell,berlin2-chip-ctrl" }, - { .compatible = "marvell,berlin2cd-chip-ctrl" }, - { .compatible = "marvell,berlin2q-chip-ctrl" }, - { }, -}; - -static int __init berlin_reset_init(void) -{ - struct device_node *np; - int ret; - - for_each_matching_node(np, berlin_reset_of_match) { - ret = __berlin_reset_init(np); - if (ret) - return ret; - } - - return 0; -} -arch_initcall(berlin_reset_init);