From patchwork Mon May 25 14:53:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6475451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 998B7C0020 for ; Mon, 25 May 2015 15:07:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2969F20148 for ; Mon, 25 May 2015 15:07:32 +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 55FA02012E for ; Mon, 25 May 2015 15:07:30 +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 1Ywtvc-0000Hk-5p; Mon, 25 May 2015 15:04:32 +0000 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ywtpr-0004aI-9c for linux-arm-kernel@lists.infradead.org; Mon, 25 May 2015 14:58:39 +0000 Received: by wizk4 with SMTP id k4so50645216wiz.1 for ; Mon, 25 May 2015 07:58:13 -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=vnbrjkGutilFSn3cBSQL/jxQrOeI76xR6KMxHWz2HFE=; b=z6itjKv+KVYlgv6fNd9w3nGopINTkzTT5h/OmcpRYFSP3e6XZLx/j9wlhSdDOs9s5G SD3q4zLdYVUuABtRd4pgFuuviOpMdoY7lOaGEIdD5ov/V1yl6mxZmduVWyzLDUQ9Jm4/ rbFm/P9n1ojA91YAM0+ctlNeaAuimMANjnLvkd7uiM7iL0NFb/E3ilJaHsQvu9eWP2nc 1f23k28CJmYqVqwO7Xh1MNC32bTrS7l163f3W+NyvlOquhMF3/14RD0Ekb03m9yRT9kb Cv4CFUFToAv1yW51LSxBSzyk0HSZY8qv/DDVVv3brxKijidwZVF1yepLMz+TI9Y3kaF4 yd4A== X-Received: by 10.194.22.40 with SMTP id a8mr41097044wjf.134.1432565893600; Mon, 25 May 2015 07:58:13 -0700 (PDT) Received: from cizrna.lan ([109.72.12.80]) by mx.google.com with ESMTPSA id ez19sm12258917wid.19.2015.05.25.07.58.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2015 07:58:12 -0700 (PDT) From: Tomeu Vizoso To: linux-arm-kernel@lists.infradead.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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150525_075835_502375_12543AAF X-CRM114-Status: UNSURE ( 9.54 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Mark Rutland , devicetree@vger.kernel.org, Tomeu Vizoso , Dmitry Torokhov , 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=ham 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 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; }