From patchwork Thu Nov 20 22:28:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 5351141 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 425FE9F1E1 for ; Thu, 20 Nov 2014 22:29:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E71520131 for ; Thu, 20 Nov 2014 22:29:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5EF1201B4 for ; Thu, 20 Nov 2014 22:29:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757152AbaKTW3B (ORCPT ); Thu, 20 Nov 2014 17:29:01 -0500 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:48035 "EHLO mho-02-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756935AbaKTW3A (ORCPT ); Thu, 20 Nov 2014 17:29:00 -0500 Received: from [104.193.169.186] (helo=sampyla.monkeybrains.net) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72) (envelope-from ) id 1XraDk-000IYh-5P; Thu, 20 Nov 2014 22:29:00 +0000 X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 104.193.169.186 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19IjIM5O1bVjwtZU53/5LwO From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Roger Quadros Subject: [PATCH 2/3] ARM: OMAP2+: Move GPMC initcall to devices.c Date: Thu, 20 Nov 2014 14:28:20 -0800 Message-Id: <1416522501-14999-3-git-send-email-tony@atomide.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1416522501-14999-1-git-send-email-tony@atomide.com> References: <1416522501-14999-1-git-send-email-tony@atomide.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 This will us allow to just move gpmc.c to live under drivers in the next patch. Note that we now also remove the omap specific check for the initcall. That's OK as gpmc_probe() checks for the pdata and bails out for other platforms compiled in. Cc: Arnd Bergmann Cc: Roger Quadros Signed-off-by: Tony Lindgren Acked-by: Roger Quadros --- arch/arm/mach-omap2/devices.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-omap2/gpmc.c | 31 +------------------------------ 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 324f02b..110256a 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -445,3 +445,29 @@ static int __init omap2_init_devices(void) return 0; } omap_arch_initcall(omap2_init_devices); + +static int __init omap_gpmc_init(void) +{ + struct omap_hwmod *oh; + struct platform_device *pdev; + char *oh_name = "gpmc"; + + /* + * if the board boots up with a populated DT, do not + * manually add the device from this initcall + */ + if (of_have_populated_dt()) + return -ENODEV; + + oh = omap_hwmod_lookup(oh_name); + if (!oh) { + pr_err("Could not look up %s\n", oh_name); + return -ENODEV; + } + + pdev = omap_device_build("omap-gpmc", -1, oh, NULL, 0); + WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name); + + return PTR_RET(pdev); +} +omap_postcore_initcall(omap_gpmc_init); diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index bc14f25..80dfb17 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -37,9 +37,6 @@ #include #include -#include "soc.h" -#include "omap_device.h" - #include #define DEVICE_NAME "omap-gpmc" @@ -2010,35 +2007,9 @@ static __exit void gpmc_exit(void) } -omap_postcore_initcall(gpmc_init); +postcore_initcall(gpmc_init); module_exit(gpmc_exit); -static int __init omap_gpmc_init(void) -{ - struct omap_hwmod *oh; - struct platform_device *pdev; - char *oh_name = "gpmc"; - - /* - * if the board boots up with a populated DT, do not - * manually add the device from this initcall - */ - if (of_have_populated_dt()) - return -ENODEV; - - oh = omap_hwmod_lookup(oh_name); - if (!oh) { - pr_err("Could not look up %s\n", oh_name); - return -ENODEV; - } - - pdev = omap_device_build(DEVICE_NAME, -1, oh, NULL, 0); - WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name); - - return PTR_RET(pdev); -} -omap_postcore_initcall(omap_gpmc_init); - static irqreturn_t gpmc_handle_irq(int irq, void *dev) { int i;