Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755541AbbG1NVp (ORCPT ); Tue, 28 Jul 2015 09:21:45 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:36454 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932300AbbG1NVW (ORCPT ); Tue, 28 Jul 2015 09:21:22 -0400 From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: Stephen Warren , Javier Martinez Canillas , Mark Brown , Thierry Reding , "Rafael J. Wysocki" , linux-arm-kernel@lists.infradead.org, Dmitry Torokhov , devicetree@vger.kernel.org, Linus Walleij , linux-acpi@vger.kernel.org, Arnd Bergmann , Tomeu Vizoso , Jaroslav Kysela , alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood Subject: [PATCH v2 22/22] ASoC: core: Probe components on demand Date: Tue, 28 Jul 2015 15:19:53 +0200 Message-Id: <1438089593-7696-23-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1438089593-7696-1-git-send-email-tomeu.vizoso@collabora.com> References: <1438089593-7696-1-git-send-email-tomeu.vizoso@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1546 Lines: 50 When looking up a component through its firmware node, probe it if it hasn't already. The goal is to reduce deferred probes to a minimum, as it makes it very cumbersome to find out why a device failed to probe, and can introduce very big delays in when a critical device is probed. Signed-off-by: Tomeu Vizoso --- Changes in v2: None sound/soc/soc-core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index c81aec9c872a..4c55da97f9ed 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -865,10 +865,12 @@ static const struct snd_soc_dai_ops null_dai_ops = { }; static struct snd_soc_component *soc_find_component( - const struct device_node *of_node, const char *name) + struct device_node *of_node, const char *name) { struct snd_soc_component *component; + fwnode_ensure_device(&of_node->fwnode); + lockdep_assert_held(&client_mutex); list_for_each_entry(component, &component_list, list) { @@ -890,6 +892,8 @@ static struct snd_soc_dai *snd_soc_find_dai( struct snd_soc_dai *dai; struct device_node *component_of_node; + fwnode_ensure_device(&dlc->of_node->fwnode); + lockdep_assert_held(&client_mutex); /* Find CPU DAI from registered DAIs*/ -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/