[PATCH 09/14] media: mt9t112: support deferred probing

Guennadi Liakhovetski g.liakhovetski at gmx.de
Fri Sep 28 00:07:28 EST 2012


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 <g.liakhovetski at gmx.de>
---
 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;
 	}
-- 
1.7.2.5



More information about the devicetree-discuss mailing list