From patchwork Thu Sep 27 14:07:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 1514461 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EA3C440B2A for ; Thu, 27 Sep 2012 14:08:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753473Ab2I0OHz (ORCPT ); Thu, 27 Sep 2012 10:07:55 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:52816 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752183Ab2I0OHx (ORCPT ); Thu, 27 Sep 2012 10:07:53 -0400 Received: from axis700.grange (dslb-178-001-228-192.pools.arcor-ip.net [178.1.228.192]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0LxHg6-1TXGUc3Rhy-016zJS; Thu, 27 Sep 2012 16:07:37 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id D5FA2189B81; Thu, 27 Sep 2012 16:07:34 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1THEkY-0007SV-CC; Thu, 27 Sep 2012 16:07:34 +0200 From: Guennadi Liakhovetski To: linux-media@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org, Sylwester Nawrocki , Laurent Pinchart , Hans Verkuil , Magnus Damm , linux-sh@vger.kernel.org, Mark Brown , Stephen Warren , Arnd Bergmann , Grant Likely Subject: [PATCH 09/14] media: mt9t112: support deferred probing Date: Thu, 27 Sep 2012 16:07:28 +0200 Message-Id: <1348754853-28619-10-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1348754853-28619-1-git-send-email-g.liakhovetski@gmx.de> References: <1348754853-28619-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:TDVlur7uWMIJA+FLG9AstXpHV2E8iThabbFuslj8F2P AP+OsO/XgBJ0ofWEmmZ/Qohq7ORHU+6zpcbabhot1xH/TrjXuM 7GkcJbMKbf1NNp9VItmOo6PVL+cLnvWlx6E3X6C3RB0KpuUtuv 92XXqY9f9A0djz0ybb+raCRly/r4kyqIYqLIJnKD3dtWlelxXr le0+jX5W4Sp4BOr0WQk8OQsotw+TtVffB0jfDH0XKIvxGSh/hK hbzy7MTOHQ4S0vivNW/V5jundKnTSBApXTjmjBsI7+kkc6lmya MWoOp3FpAgofiePAzd4452Hvq41LbH2UntVM6FcpWs30DmxHvc fMTwsubnVffD10LBvsOn/RwJHs3L1ch4HAjpauYCzChTJ5vBvr gOJEG4Xqw/m/38fntCGBuvyMtJUjchuJ6c= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If .probe() is called without our private data, this might mean, that the host driver hasn't probed yet. Defer probing in this case. Signed-off-by: Guennadi Liakhovetski --- drivers/media/i2c/soc_camera/mt9t112.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/media/i2c/soc_camera/mt9t112.c b/drivers/media/i2c/soc_camera/mt9t112.c index dfa03f0..9e0837c 100644 --- a/drivers/media/i2c/soc_camera/mt9t112.c +++ b/drivers/media/i2c/soc_camera/mt9t112.c @@ -1094,7 +1094,10 @@ static int mt9t112_probe(struct i2c_client *client, }; int ret; - if (!icl || !icl->priv) { + if (!icl) + return -EPROBE_DEFER; + + if (!icl->priv) { dev_err(&client->dev, "mt9t112: missing platform data!\n"); return -EINVAL; }