From patchwork Wed Apr 4 12:57:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 10322587 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 89B126053F for ; Wed, 4 Apr 2018 12:59:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77AF628E9E for ; Wed, 4 Apr 2018 12:59:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C86428EA0; Wed, 4 Apr 2018 12:59:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4E2DD28E9E for ; Wed, 4 Apr 2018 12:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=x7VbB7j5JHk3FoAxRQhRKYsaM0IXVeM4xuPYAeps89Y=; b=u/jE1B8xRjhEBs G82XuL7MtmjrcCfb7K+LqxwMHf9zvv/8UaPcP2Po5a1akLghXa8i88a4FL1CtsrgpSsOIMrMt16bG iWnd4AH+TfbzGiUPntSVwhi+MDYTKol/eOSoJCLqIPHFb2eVFsdK0ba81EuVRzYBdelGe6tN/A8Wb i+LQewoXV7TZdS5hWco7ARaH47Knv5ER4u4I6CYm9yBSR0EJ0GYjIwxnMEw/HZMl+5VhkN3qEhbXN 1ixM6pCOa2q5tQLqceOsbl7a/3RLq+0w4OeMQbLXianKYv6T8IoQ4BtDIH8jcRfCMbPQvt5IYzWEy vMWsrNh/wJSB1Aukyu6w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3i0G-0005CZ-2T; Wed, 04 Apr 2018 12:59:04 +0000 Received: from lelnx193.ext.ti.com ([198.47.27.77]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3i0C-0005BN-9N for linux-arm-kernel@lists.infradead.org; Wed, 04 Apr 2018 12:59:02 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w34Cw3L2011919; Wed, 4 Apr 2018 07:58:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1522846683; bh=IBzoyze0dpr9t6HghyzlmPqwpsADVMfQ0qAqa1OYpRA=; h=From:To:CC:Subject:Date; b=cqPbmeG8lq/YLMhnXzafXapFcv7p81ScJByTn2BADzHzjshE15GqLEi6QJ6PjFZ28 TaCnWJz+e3MhipreSDrgO5hStseMx7h/QrWkdmIlKAhYE8NHKxt2HelymzZxPSTbWp sR8skU8KyKv2+btjNMo3Y79XQ0XeedRROCHuqaTY= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w34Cw2tD001749; Wed, 4 Apr 2018 07:58:03 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 4 Apr 2018 07:58:02 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 4 Apr 2018 07:58:02 -0500 Received: from psplinux063.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w34Cvx1E013497; Wed, 4 Apr 2018 07:58:00 -0500 From: Sekhar Nori To: Linux ARM Mailing List Subject: [PATCH] ARM: davinci: dm644x: remove unnecessary postcore_initcall() Date: Wed, 4 Apr 2018 18:27:59 +0530 Message-ID: <20180404125759.27061-1-nsekhar@ti.com> X-Mailer: git-send-email 2.16.2 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180404_055900_415639_E49F1706 X-CRM114-Status: GOOD ( 18.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , Sekhar Nori , David Lechner , Kevin Hilman Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP dm644x_init_devices() is unnecessarily implemented as a postcore_initcall(). This does not cause any issues now, but creates issues when converting to common clock framework where clocks themselves become platform devices and are initialized later. Because of this, device clock acquisition and runtime PM on that device fails. Move the call to .init_machine() callback along with rest of platform device's registration. Signed-off-by: Sekhar Nori --- arch/arm/mach-davinci/board-dm644x-evm.c | 5 +++++ arch/arm/mach-davinci/board-neuros-osd2.c | 5 +++++ arch/arm/mach-davinci/board-sffsdr.c | 6 ++++++ arch/arm/mach-davinci/davinci.h | 1 + arch/arm/mach-davinci/dm644x.c | 6 +----- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index 95b55aae1366..d1a7239a80d6 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -768,6 +768,11 @@ static __init void davinci_evm_init(void) struct clk *aemif_clk; struct davinci_soc_info *soc_info = &davinci_soc_info; + ret = dm644x_init_devices(); + if (ret) + pr_warn("%s: dm644x_init_devices() failed: %d\n", + __func__, ret); + ret = dm644x_gpio_register(); if (ret) pr_warn("%s: GPIO init failed: %d\n", __func__, ret); diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c index f2875770fbff..23f4f0b70752 100644 --- a/arch/arm/mach-davinci/board-neuros-osd2.c +++ b/arch/arm/mach-davinci/board-neuros-osd2.c @@ -174,6 +174,11 @@ static __init void davinci_ntosd2_init(void) struct clk *aemif_clk; struct davinci_soc_info *soc_info = &davinci_soc_info; + ret = dm644x_init_devices(); + if (ret) + pr_warn("%s: dm644x_init_devices() failed: %d\n", + __func__, ret); + ret = dm644x_gpio_register(); if (ret) pr_warn("%s: GPIO init failed: %d\n", __func__, ret); diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c index 2922da9d1684..d9900d7c26d3 100644 --- a/arch/arm/mach-davinci/board-sffsdr.c +++ b/arch/arm/mach-davinci/board-sffsdr.c @@ -133,6 +133,12 @@ static void __init davinci_sffsdr_map_io(void) static __init void davinci_sffsdr_init(void) { struct davinci_soc_info *soc_info = &davinci_soc_info; + int ret; + + ret = dm644x_init_devices(); + if (ret) + pr_warn("%s: dm644x_init_devices() failed: %d\n", + __func__, ret); platform_add_devices(davinci_sffsdr_devices, ARRAY_SIZE(davinci_sffsdr_devices)); diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h index 270cef85750a..0ba37d68ecb4 100644 --- a/arch/arm/mach-davinci/davinci.h +++ b/arch/arm/mach-davinci/davinci.h @@ -104,6 +104,7 @@ int dm365_gpio_register(void); /* DM644x function declarations */ void dm644x_init(void); +int dm644x_init_devices(void); void dm644x_init_time(void); void dm644x_init_asp(void); int dm644x_init_video(struct vpfe_config *, struct vpbe_config *); diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index b409801649e1..da833290291b 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -961,14 +961,11 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg, return 0; } -static int __init dm644x_init_devices(void) +int __init dm644x_init_devices(void) { struct platform_device *edma_pdev; int ret = 0; - if (!cpu_is_davinci_dm644x()) - return 0; - edma_pdev = platform_device_register_full(&dm644x_edma_device); if (IS_ERR(edma_pdev)) { pr_warn("%s: Failed to register eDMA\n", __func__); @@ -984,4 +981,3 @@ static int __init dm644x_init_devices(void) return ret; } -postcore_initcall(dm644x_init_devices);