Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751612AbbEYO6a (ORCPT ); Mon, 25 May 2015 10:58:30 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:34056 "EHLO mail-wg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751111AbbEYO6P (ORCPT ); Mon, 25 May 2015 10:58:15 -0400 From: Tomeu Vizoso To: linux-arm-kernel@lists.infradead.org Cc: =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Thierry Reding , Dmitry Torokhov , Alexander Holler , Grant Likely , Rob Herring , Mark Rutland , Tomeu Vizoso , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/21] of/platform: Ensure device registration on lookup Date: Mon, 25 May 2015 16:53:11 +0200 Message-Id: <1432565608-26036-8-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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1034 Lines: 32 When looking up a platform device from its device node, ensure that the device has been registered before doing the actual search. This increases the chances of the device having been probed by that time, reducing deferred probes. Signed-off-by: Tomeu Vizoso --- drivers/of/platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index cc5d808..af2bc75 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -46,6 +46,8 @@ struct platform_device *of_find_device_by_node(struct device_node *np) { struct device *dev; + of_platform_device_ensure(np); + dev = bus_find_device(&platform_bus_type, NULL, np, of_dev_node_match); return dev ? to_platform_device(dev) : NULL; } -- 2.4.1 -- 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/