From patchwork Mon May 12 16:48:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Holler X-Patchwork-Id: 4160341 Return-Path: X-Original-To: patchwork-linux-arm@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 E8C2F9F1C0 for ; Mon, 12 May 2014 17:00:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 079E6202DD for ; Mon, 12 May 2014 17:00:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 18D0B2018A for ; Mon, 12 May 2014 17:00:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WjtYE-00015U-SR; Mon, 12 May 2014 16:58:06 +0000 Received: from h1446028.stratoserver.net ([85.214.92.142] helo=mail.ahsoftware.de) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WjtY5-0000mr-RL for linux-arm-kernel@lists.infradead.org; Mon, 12 May 2014 16:57:58 +0000 Received: by mail.ahsoftware.de (Postfix, from userid 65534) id 3B826423C2FD; Mon, 12 May 2014 18:57:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from eiche.ahsoftware (p57B21A99.dip0.t-ipconnect.de [87.178.26.153]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.ahsoftware.de (Postfix) with ESMTPSA id E4D79423C2F9 for ; Mon, 12 May 2014 18:57:38 +0200 (CEST) Received: by eiche.ahsoftware (Postfix, from userid 65534) id 32E6C7F91E; Mon, 12 May 2014 18:57:38 +0200 (CEST) Received: from krabat.ahsoftware (unknown [192.168.207.2]) by eiche.ahsoftware (Postfix) with ESMTP id 73E27817C1; Mon, 12 May 2014 16:48:39 +0000 (UTC) From: Alexander Holler To: linux-kernel@vger.kernel.org Subject: [RFC PATCH 9/9] dt: deps: omap2: make it possible to use CONFIG_OF_DEPENDENCIES Date: Mon, 12 May 2014 18:48:00 +0200 Message-Id: <1399913280-6915-10-git-send-email-holler@ahsoftware.de> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1399913280-6915-1-git-send-email-holler@ahsoftware.de> References: <1399913280-6915-1-git-send-email-holler@ahsoftware.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140512_095758_075211_1502B7A2 X-CRM114-Status: GOOD ( 14.79 ) X-Spam-Score: -0.0 (/) Cc: devicetree@vger.kernel.org, Jon Loeliger , Russell King , Greg Kroah-Hartman , Rob Herring , Grant Likely , Alexander Holler , linux-arm-kernel@lists.infradead.org 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-Virus-Scanned: ClamAV using ClamSMTP Use the feature of dependency based initialization order for drivers if CONFIG_OF_DEPENDENCIES is enabled. This patch also includes a change for a driver which does call of_platform_populate() itself. This shouldn't be done or necessary when CONFIG_OF_DEPENDENCIES is enabled. Signed-off-by: Alexander Holler --- arch/arm/mach-omap2/pdata-quirks.c | 8 ++++++++ drivers/pwm/pwm-tipwmss.c | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index c33e07e..80becdb 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -312,7 +313,14 @@ void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table) { omap_sdrc_init(NULL, NULL); pdata_quirks_check(auxdata_quirks); +#ifdef CONFIG_OF_DEPENDENCIES + if (!of_init_build_order(NULL, NULL)) + of_init_create_devices(NULL, omap_auxdata_lookup); + else + of_init_free_order(); +#else of_platform_populate(NULL, omap_dt_match_table, omap_auxdata_lookup, NULL); +#endif pdata_quirks_check(pdata_quirks); } diff --git a/drivers/pwm/pwm-tipwmss.c b/drivers/pwm/pwm-tipwmss.c index 3b119bc..786fa39 100644 --- a/drivers/pwm/pwm-tipwmss.c +++ b/drivers/pwm/pwm-tipwmss.c @@ -78,10 +78,15 @@ static int pwmss_probe(struct platform_device *pdev) pm_runtime_get_sync(&pdev->dev); platform_set_drvdata(pdev, info); +#ifndef CONFIG_OF_DEPENDENCIES /* Populate all the child nodes here... */ ret = of_platform_populate(node, NULL, NULL, &pdev->dev); if (ret) dev_err(&pdev->dev, "no child node found\n"); +#else + /* dependency based initialization already has setup devices */ + ret = 0; +#endif return ret; }