From patchwork Mon May 25 14:53:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6475221 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0F0879F1CC for ; Mon, 25 May 2015 15:02:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 598C0203AC for ; Mon, 25 May 2015 15:02:35 +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 71C4F201CE for ; Mon, 25 May 2015 15:02:34 +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 1Ywtqf-0004ru-H5; Mon, 25 May 2015 14:59:25 +0000 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ywtpj-0004ZR-N1 for linux-arm-kernel@lists.infradead.org; Mon, 25 May 2015 14:58:32 +0000 Received: by wicmx19 with SMTP id mx19so50540274wic.0 for ; Mon, 25 May 2015 07:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JM+s26BporO7oxO5OiZz5gTQF26fYZdNImDWgCVeMZE=; b=0KE22d7qjZNQTc6i/tBrAWVBzm9A/4lP3g5qYUORhHpQHPpXAFaPlUWapNxd3OA9wp LVW6u1exA1CRnIVeKVANw3dpy36OUg0I+ixiFSVjOjkJINqpcTx1qucjXTyMckm8DBRj 6VRXVMMotRGXGgSz+8vgE24nsFGb9Z8ZIdGeRTF/fcJG4GTIlONBYzO1p740REGRWZyL UM4F6GdOq6oNrFNZ+PugmRRI8mADLtUfF1QYuxFBTRJTxc4hDy4PKLJsvkII2dLBailx k0qFxV63lwqylIiAjfsIlQgqL/bYVXkp6AmOoEgb/Z+2H54XNwqt06fswRYirnLKq1k9 bXPA== X-Received: by 10.194.190.168 with SMTP id gr8mr38484377wjc.83.1432565885862; Mon, 25 May 2015 07:58:05 -0700 (PDT) Received: from cizrna.lan ([109.72.12.80]) by mx.google.com with ESMTPSA id ez19sm12258917wid.19.2015.05.25.07.58.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2015 07:58:05 -0700 (PDT) From: Tomeu Vizoso To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 03/21] ARM: tegra: Register drivers before devices Date: Mon, 25 May 2015 16:53:07 +0200 Message-Id: <1432565608-26036-4-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1432565608-26036-1-git-send-email-tomeu.vizoso@collabora.com> References: <1432565608-26036-1-git-send-email-tomeu.vizoso@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150525_075827_905177_B76946FA X-CRM114-Status: GOOD ( 12.79 ) X-Spam-Score: -0.7 (/) Cc: Mark Rutland , Alexandre Courbot , Russell King , Tomeu Vizoso , Stephen Warren , Dmitry Torokhov , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Thierry Reding , Grant Likely , Alexander Holler X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, 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 So devices can be probed on demand, we need to have the drivers already registered as we don't have enough information to register a driver on demand. Signed-off-by: Tomeu Vizoso --- arch/arm/mach-tegra/tegra.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c index 861d884..2874425 100644 --- a/arch/arm/mach-tegra/tegra.c +++ b/arch/arm/mach-tegra/tegra.c @@ -55,6 +55,8 @@ #include "reset.h" #include "sleep.h" +static struct soc_device *soc_dev; + /* * Storage for debug-macro.S's state. * @@ -87,12 +89,10 @@ static void __init tegra_dt_init_irq(void) static void __init tegra_dt_init(void) { struct soc_device_attribute *soc_dev_attr; - struct soc_device *soc_dev; - struct device *parent = NULL; soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); if (!soc_dev_attr) - goto out; + return; soc_dev_attr->family = kasprintf(GFP_KERNEL, "Tegra"); soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d", @@ -105,17 +105,7 @@ static void __init tegra_dt_init(void) kfree(soc_dev_attr->revision); kfree(soc_dev_attr->soc_id); kfree(soc_dev_attr); - goto out; } - - parent = soc_device_to_device(soc_dev); - - /* - * Finished with the static registrations now; fill in the missing - * devices - */ -out: - of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); } static void __init paz00_init(void) @@ -133,8 +123,13 @@ static struct { static void __init tegra_dt_init_late(void) { + struct device *parent = NULL; int i; + parent = soc_device_to_device(soc_dev); + + of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); + tegra_init_suspend(); tegra_cpuidle_init();