From patchwork Thu May 30 10:43:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Tseglytskyi X-Patchwork-Id: 2635871 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 556C13FD2B for ; Thu, 30 May 2013 10:44:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030539Ab3E3KoM (ORCPT ); Thu, 30 May 2013 06:44:12 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:40331 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030476Ab3E3KoD (ORCPT ); Thu, 30 May 2013 06:44:03 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4UAi1Oq000859; Thu, 30 May 2013 05:44:01 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r4UAi1Vr011422; Thu, 30 May 2013 05:44:01 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Thu, 30 May 2013 05:44:01 -0500 Received: from localhost (uglx0174653.ucm2.emeaucm.ext.ti.com [10.167.145.64]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r4UAi1uq020371; Thu, 30 May 2013 05:44:01 -0500 From: Andrii Tseglytskyi To: , CC: , , Subject: [PATCH v1 2/2] PM / AVS: SmartReflex/class3: Fix order of initialization of SR class and SR driver Date: Thu, 30 May 2013 13:43:57 +0300 Message-ID: <1369910637-19100-3-git-send-email-andrii.tseglytskyi@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1369910637-19100-1-git-send-email-andrii.tseglytskyi@ti.com> References: <1369910637-19100-1-git-send-email-andrii.tseglytskyi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org SmartReflex consists of three entities: SR device, SR class and SR driver. SmartReflex driver depends on SmartReflex class, but order of their initialization is not clear. They both use late_initcall(), and order depends on Makefile calls. Patch moves initialization of SR class to device_initcall(), and removes redundant call of sr_late_init(). This provides predictable order of SmartReflex initcalls: 1. device_initcall() -> SmartReflex class init 2. late_initcall() -> SmartReflex driver init Signed-off-by: Andrii Tseglytskyi --- arch/arm/mach-omap2/smartreflex-class3.c | 2 +- drivers/power/avs/smartreflex.c | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c index aee3c89..50523b8 100644 --- a/arch/arm/mach-omap2/smartreflex-class3.c +++ b/arch/arm/mach-omap2/smartreflex-class3.c @@ -59,4 +59,4 @@ static int __init sr_class3_init(void) pr_info("SmartReflex Class3 initialized\n"); return sr_register_class(&class3_data); } -omap_late_initcall(sr_class3_init); +omap_device_initcall(sr_class3_init); diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c index 60cf0ee..8a68b4f 100644 --- a/drivers/power/avs/smartreflex.c +++ b/drivers/power/avs/smartreflex.c @@ -651,8 +651,6 @@ void sr_disable(struct voltagedomain *voltdm) */ int sr_register_class(struct omap_sr_class_data *class_data) { - struct omap_sr *sr_info; - if (!class_data) { pr_warning("%s:, Smartreflex class data passed is NULL\n", __func__); @@ -667,13 +665,6 @@ int sr_register_class(struct omap_sr_class_data *class_data) sr_class = class_data; - /* - * Call into late init to do intializations that require - * both sr driver and sr class driver to be initiallized. - */ - list_for_each_entry(sr_info, &sr_list, node) - sr_late_init(sr_info); - return 0; }