From patchwork Fri Jul 26 10:05:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 2833981 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9BD90C0319 for ; Fri, 26 Jul 2013 10:47:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A294420179 for ; Fri, 26 Jul 2013 10:47:37 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CA6220178 for ; Fri, 26 Jul 2013 10:47:36 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2f0L-0001fr-Oz; Fri, 26 Jul 2013 10:12:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2ezh-0003xq-C6; Fri, 26 Jul 2013 10:11:29 +0000 Received: from mail-pb0-x22d.google.com ([2607:f8b0:400e:c01::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V2ezd-0003wS-TQ for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2013 10:11:26 +0000 Received: by mail-pb0-f45.google.com with SMTP id mc8so1852042pbc.18 for ; Fri, 26 Jul 2013 03:11:04 -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:x-mailer:in-reply-to:references; bh=W2HJm/PXbMui1IUu+TrKWdGN0fkqkVs5PK2Jf7cBc5w=; b=XXy8KixcXhBogXov7lU8+baWyGjgX3ReL88rFox03X4+ZdetjmZzaKhAPf6/7k+qRb QcVnRcSVJjPLtsq9kefSZLZuh/fKiXVbmRV5Zc1Nj9UFPT/Hjhih6NlrO/Y7LWRkdqju 7xlJ/JYVtiq0kmswy9bwDgPm0wz31230CdLlKzrB5hSQKzgoJ/u0uxGAOnQrh/bU9Bob oSAcMAE5VFefgCD3Lf3mBsdJp3RZ25rK3wR69sJQ9prow5zKcV6Q40TfghSE7sKhRkBf tkGojtwqbXvLgO5z2xONW+R4WdrBBKOy/K8HRbl97BB42Z5iK2zoAiTxnl9B2lMa+IcV 8cDg== X-Received: by 10.68.99.129 with SMTP id eq1mr4268260pbb.36.1374833464313; Fri, 26 Jul 2013 03:11:04 -0700 (PDT) Received: from localhost.localdomain ([67.229.68.101]) by mx.google.com with ESMTPSA id kc8sm59263070pbc.18.2013.07.26.03.10.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 03:11:03 -0700 (PDT) From: Haojian Zhuang To: tglx@linutronix.de, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, chao.xie@marvell.com, john.stultz@linaro.org, mturquette@linaro.org, eric.y.miao@gmail.com, linux@arm.linux.org.uk, olof@lixom.net Subject: [PATCH v6 08/11] ARM: pxa: init dma debugfs in late level Date: Fri, 26 Jul 2013 18:05:30 +0800 Message-Id: <1374833133-21119-9-git-send-email-haojian.zhuang@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1374833133-21119-1-git-send-email-haojian.zhuang@gmail.com> References: <1374833133-21119-1-git-send-email-haojian.zhuang@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130726_061126_036094_D9647AD1 X-CRM114-Status: GOOD ( 16.45 ) X-Spam-Score: -2.0 (--) Cc: Haojian Zhuang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-5.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Remove pxa_init_dma() from core_initcall level since it's unncecssary for DT mode. But dma debugfs is also included in pxa_init_dma(). So only initiliaze dma debugfs in late_initcall level. Signed-off-by: Haojian Zhuang --- arch/arm/mach-mmp/mmp2.c | 2 +- arch/arm/mach-mmp/pxa168.c | 2 +- arch/arm/mach-mmp/pxa910.c | 2 +- arch/arm/plat-pxa/dma.c | 30 ++++++++++++++++++++---------- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c index f26ea9d..a0abfd7 100644 --- a/arch/arm/mach-mmp/mmp2.c +++ b/arch/arm/mach-mmp/mmp2.c @@ -114,7 +114,6 @@ static int __init mmp2_init(void) return 0; } -postcore_initcall(mmp2_init); #define APBC_TIMERS APBC_REG(0x024) @@ -122,6 +121,7 @@ void __init mmp2_timer_init(void) { unsigned long clk_rst; + mmp2_init(); __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS); /* diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index b6b3d5b..a332d51 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c @@ -61,7 +61,6 @@ static int __init pxa168_init(void) return 0; } -postcore_initcall(pxa168_init); /* system timer - clock enabled, 3.25MHz */ #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) @@ -69,6 +68,7 @@ postcore_initcall(pxa168_init); void __init pxa168_timer_init(void) { + pxa168_init(); /* this is early, we have to initialize the CCU registers by * ourselves instead of using clk_* API. Clock rate is defined * by APBC_TIMERS_CLK_RST (3.25MHz) and enabled free-running diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index df379c2..1a84800 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c @@ -100,7 +100,6 @@ static int __init pxa910_init(void) return 0; } -postcore_initcall(pxa910_init); /* system timer - clock enabled, 3.25MHz */ #define TIMER_CLK_RST (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3)) @@ -108,6 +107,7 @@ postcore_initcall(pxa910_init); void __init pxa910_timer_init(void) { + pxa910_init(); /* reset and configure */ __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS); __raw_writel(TIMER_CLK_RST, APBC_TIMERS); diff --git a/arch/arm/plat-pxa/dma.c b/arch/arm/plat-pxa/dma.c index 79ef102..6c5472b 100644 --- a/arch/arm/plat-pxa/dma.c +++ b/arch/arm/plat-pxa/dma.c @@ -228,36 +228,46 @@ err_state: return NULL; } -static void pxa_dma_init_debugfs(void) +static int __init pxa_dma_init_debugfs(void) { - int i; + int i, ret; struct dentry *chandir; dbgfs_root = debugfs_create_dir(DMA_DEBUG_NAME, NULL); - if (IS_ERR(dbgfs_root) || !dbgfs_root) + if (IS_ERR(dbgfs_root) || !dbgfs_root) { + ret = -EINVAL; goto err_root; + } dbgfs_state = debugfs_create_file("state", 0400, dbgfs_root, NULL, &dbg_fops_state); - if (!dbgfs_state) + if (!dbgfs_state) { + ret = -EINVAL; goto err_state; + } dbgfs_chan = kmalloc(sizeof(*dbgfs_state) * num_dma_channels, GFP_KERNEL); - if (!dbgfs_chan) + if (!dbgfs_chan) { + ret = -ENOMEM; goto err_alloc; + } chandir = debugfs_create_dir("channels", dbgfs_root); - if (!chandir) + if (!chandir) { + ret = -EINVAL; goto err_chandir; + } for (i = 0; i < num_dma_channels; i++) { dbgfs_chan[i] = pxa_dma_dbg_alloc_chan(i, chandir); - if (!dbgfs_chan[i]) + if (!dbgfs_chan[i]) { + ret = -EINVAL; goto err_chans; + } } - return; + return 0; err_chans: err_chandir: kfree(dbgfs_chan); @@ -266,7 +276,9 @@ err_state: debugfs_remove_recursive(dbgfs_root); err_root: pr_err("pxa_dma: debugfs is not available\n"); + return ret; } +late_initcall(pxa_dma_init_debugfs); static void __exit pxa_dma_cleanup_debugfs(void) { @@ -385,7 +397,5 @@ int __init pxa_init_dma(int irq, int num_ch) } num_dma_channels = num_ch; - pxa_dma_init_debugfs(); - return 0; }