From patchwork Mon May 25 14:53:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6475511 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 5D9179F1CC for ; Mon, 25 May 2015 15:12:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B01CD20381 for ; Mon, 25 May 2015 15:12:12 +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 ED5B7203DA for ; Mon, 25 May 2015 15:12:08 +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 1Ywu02-0004x6-HD; Mon, 25 May 2015 15:09:06 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ywtq3-0004cC-Qd for linux-arm-kernel@lists.infradead.org; Mon, 25 May 2015 14:58:51 +0000 Received: by wizk4 with SMTP id k4so50649961wiz.1 for ; Mon, 25 May 2015 07:58:25 -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=TJOAqgE+cvyvnePJLAK3dmCMQ0uiEwDMq9M3TWLMu9A=; b=pIs2zyWHwY5ugbDCKQ8PUPSHK+TriP50eKDatE+M4Uy6dAhZ1nLAH1pS59yxqdcdLy KjjCopaN5paKQmbvqyGOLLBslXrLBVAprFF3RvfuuJhOqtMJH9DRaNbPb2DibJMecMnh YH8oqERyuoOV09WplWC0rnAAIiIJIZAPUH0y7tnbbm+VziAMU8x0pA9oTuMUovdNsiPu o2bofvIKWf4xQWiOpCULypXw3SQUtxXx2Yiu3WXQVuyZGGfILuMi73h/MD79Bc5l7/Hx IF3dVpa0o9auczIudGb5TxL9YoZemlL/JhYbNIS0JX1KuZt23s5S15Drn+1iN8AVtLvt VTKA== X-Received: by 10.180.230.199 with SMTP id ta7mr13639767wic.1.1432565905544; Mon, 25 May 2015 07:58:25 -0700 (PDT) Received: from cizrna.lan ([109.72.12.80]) by mx.google.com with ESMTPSA id ez19sm12258917wid.19.2015.05.25.07.58.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2015 07:58:24 -0700 (PDT) From: Tomeu Vizoso To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 13/21] i2c: core: Probe i2c master devices on demand Date: Mon, 25 May 2015 16:53:17 +0200 Message-Id: <1432565608-26036-14-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_075848_073290_9D12EA2E X-CRM114-Status: UNSURE ( 9.02 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Mark Rutland , Tomeu Vizoso , Wolfram Sang , Dmitry Torokhov , linux-kernel@vger.kernel.org, Rob Herring , =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Thierry Reding , linux-i2c@vger.kernel.org, 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 When looking up an i2c master through its DT node, ensure that the corresponding device has been registered. Signed-off-by: Tomeu Vizoso --- drivers/i2c/i2c-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 987c124..8c9352e 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -1339,6 +1340,8 @@ struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node) { struct device *dev; + of_platform_device_ensure(node); + dev = bus_find_device(&i2c_bus_type, NULL, node, of_dev_node_match); if (!dev)