From: Lad, Prabhakar Date: Fri, 27 Feb 2015 16:10:19 +0000 (-0300) Subject: [media] media: i2c: mt9p031: add support for asynchronous probing X-Git-Tag: firefly_0821_release~176^2~795^2~1142 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9012d0888c8fc473d5760f2367b002dfddee80f9;p=firefly-linux-kernel-4.4.55.git [media] media: i2c: mt9p031: add support for asynchronous probing Both synchronous and asynchronous mt9p031 subdevice probing is supported by this patch. Signed-off-by: Lad, Prabhakar Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c index 2bf0e6843955..9258d048a1e3 100644 --- a/drivers/media/i2c/mt9p031.c +++ b/drivers/media/i2c/mt9p031.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -1145,6 +1146,10 @@ static int mt9p031_probe(struct i2c_client *client, } ret = mt9p031_clk_setup(mt9p031); + if (ret) + goto done; + + ret = v4l2_async_register_subdev(&mt9p031->subdev); done: if (ret < 0) { @@ -1162,7 +1167,7 @@ static int mt9p031_remove(struct i2c_client *client) struct mt9p031 *mt9p031 = to_mt9p031(subdev); v4l2_ctrl_handler_free(&mt9p031->ctrls); - v4l2_device_unregister_subdev(subdev); + v4l2_async_unregister_subdev(subdev); media_entity_cleanup(&subdev->entity); mutex_destroy(&mt9p031->power_lock);