From patchwork Mon May 25 14:53:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 476232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8B6841402B4 for ; Tue, 26 May 2015 01:00:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=MnhaUZMn; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751721AbbEYO6k (ORCPT ); Mon, 25 May 2015 10:58:40 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:37743 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751702AbbEYO6i (ORCPT ); Mon, 25 May 2015 10:58:38 -0400 Received: by wifw1 with SMTP id w1so332155wif.0; Mon, 25 May 2015 07:58:37 -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=GC8arGleGqhaAqiLo3tfv+ls/kHFj8ZywEXeQt5NN1I=; b=MnhaUZMnoWHkmuVwUNATW0Lxjk425Vj7TCpgfAjbkb6s0upfZIUHkfxtIqIOCXjq1f rCO0YgpITuZrqSGItT9KhsILBmUUVDO3H4v/egebYwfojqQCVT7B2CZuN0YP1wufmiKz l3VDrg3tfxYnhDkWJRYqk1X1hMHzFancnmBA4HCE9Z2wErKqcfIjUufOa3Q6Jk8qwyXQ bmb5nlVsbVGW2kfMcV4KwSSip9XSWi2J56G0FbMJKFjxPzqFq0hUEgplxgrfOazz6wZn xMYnIYsBXMzggK8EmQjut/Dvs0M/yoWCc6HnZ/IzTn8tR/a1ixV8jeQwu2MW7yiyqiz8 2k1Q== X-Received: by 10.180.39.147 with SMTP id p19mr32131765wik.15.1432565917342; Mon, 25 May 2015 07:58:37 -0700 (PDT) Received: from cizrna.lan ([109.72.12.80]) by mx.google.com with ESMTPSA id ez19sm12258917wid.19.2015.05.25.07.58.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2015 07:58:36 -0700 (PDT) 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 , Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/21] pinctrl: Probe pinctrl devices on demand Date: Mon, 25 May 2015 16:53:22 +0200 Message-Id: <1432565608-26036-19-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-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org When looking up a pin controller through its DT node, ensure that the corresponding device has been registered. Signed-off-by: Tomeu Vizoso --- drivers/pinctrl/devicetree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index 0bbf7d7..17231ea 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -118,6 +119,7 @@ static int dt_to_map_one_config(struct pinctrl *p, const char *statename, /* Find the pin controller containing np_config */ np_pctldev = of_node_get(np_config); + of_platform_device_ensure(np_pctldev); for (;;) { np_pctldev = of_get_next_parent(np_pctldev); if (!np_pctldev || of_node_is_root(np_pctldev)) {