From patchwork Mon Jun 3 09:30:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 17438 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1CAAA23916 for ; Mon, 3 Jun 2013 09:32:34 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id fo13sf3591120lab.1 for ; Mon, 03 Jun 2013 02:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=/tFFUdL3pk8C7W+RRXxRU5Owik1QPfmdQJIImifW/FU=; b=ve9IGvCaLW9vRuVPfebu1wclu0ugp35UnrKzlQn3TDf85lb+Q7BRkEUcZ3WbSObZ9E 4QwywxEwktvwI3VAGBdkiZaE375Tw3WhuxO8LriZa+WkXQqHdTCNON0cVCSjj++fJfEv qwtDzdRxF4FYS7xP9ouk19MKZf6KYi0qrX9w1kZSBq+mjUgIkzHU1WCS6ygFx0aONJKy uyZJMsPgUapAV+IY0nAcNFQb8gZsm7n71ziMVUPy6yKVsjvHUb+a3FvYcmxQB+d05Dse VF9dkdE5pBEqIjSCmqP3nALe5m5Uqjci/+FPNuuXoBilMF2KbqHNfuBTA1yR0uSFe7zB T2nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=/tFFUdL3pk8C7W+RRXxRU5Owik1QPfmdQJIImifW/FU=; b=b9XhoCMMxPcBnJQPqZDn7MqnvpW3DoMezAUR6nqqh+Clk0d/jHwNQqHbYqg2hcve1C RfKsLyaqbF2Bzh8p+0MDjb7qZDUHfQq0+ug5KUwFm7xaxoTuJaqqAHbXw9ZJjiAqPYbP jywx5UPT4oNGIZGb9Tr8YSWk8ioxlKG+/l8bb0u0+UkDPk+TM6HUQZvAKnMOBBOT6Dud g3A6Y/XErMYpOhy8GiInLABaRRazBeKvlJgSkHPf43w8Cf1m69+zdfwDGPMcbMQrgMhI jaAgWklWA35n2Gz2ptOwmBnE0qlJl97ywf+CDC9L5rHQ5xpQWqjSfVPeDiH31m+zWrkS QgVQ== X-Received: by 10.180.206.107 with SMTP id ln11mr4500348wic.7.1370251953474; Mon, 03 Jun 2013 02:32:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.90.70 with SMTP id bu6ls751739wib.30.gmail; Mon, 03 Jun 2013 02:32:33 -0700 (PDT) X-Received: by 10.180.187.234 with SMTP id fv10mr11550126wic.29.1370251953325; Mon, 03 Jun 2013 02:32:33 -0700 (PDT) Received: from mail-ve0-x229.google.com (mail-ve0-x229.google.com [2607:f8b0:400c:c01::229]) by mx.google.com with ESMTPS id g10si18303536wjb.97.2013.06.03.02.32.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 02:32:33 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::229 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::229; Received: by mail-ve0-f169.google.com with SMTP id m1so2594824ves.14 for ; Mon, 03 Jun 2013 02:32:32 -0700 (PDT) X-Received: by 10.52.53.36 with SMTP id y4mr13709983vdo.51.1370251952165; Mon, 03 Jun 2013 02:32:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp71070vcb; Mon, 3 Jun 2013 02:32:31 -0700 (PDT) X-Received: by 10.66.232.230 with SMTP id tr6mr18919322pac.83.1370251951204; Mon, 03 Jun 2013 02:32:31 -0700 (PDT) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by mx.google.com with ESMTPS id vs6si14790356pbc.281.2013.06.03.02.32.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 02:32:30 -0700 (PDT) Received-SPF: pass (google.com: domain of haojian.zhuang@gmail.com designates 209.85.192.182 as permitted sender) client-ip=209.85.192.182; Received: by mail-pd0-f182.google.com with SMTP id g10so5358799pdj.41 for ; Mon, 03 Jun 2013 02:32:29 -0700 (PDT) X-Received: by 10.68.0.131 with SMTP id 3mr3783869pbe.124.1370251948954; Mon, 03 Jun 2013 02:32:28 -0700 (PDT) Received: from localhost.localdomain ([27.115.121.40]) by mx.google.com with ESMTPSA id wi6sm58333510pbc.22.2013.06.03.02.32.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Jun 2013 02:32:27 -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 Cc: patches@linaro.org, Haojian Zhuang Subject: [PATCH v3 08/11] ARM: pxa: init dma debugfs in late level Date: Mon, 3 Jun 2013 17:30:42 +0800 Message-Id: <1370251845-31373-9-git-send-email-haojian.zhuang@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1370251845-31373-1-git-send-email-haojian.zhuang@gmail.com> References: <1370251845-31373-1-git-send-email-haojian.zhuang@gmail.com> X-Gm-Message-State: ALoCoQlZpfXP8EdaOZHK1FfNNrFXhGtN9unw7OZcjRNXO/uek6YsCrZJAjTkV94rPRUf98m6JjiT X-Original-Sender: haojian.zhuang@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::229 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gmail.com Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 4dbf3e0..c0cdb62 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 a30dcf3..87e1bcb 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 df7e33f..da5c299 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; }