From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941032AbcIHNGB (ORCPT ); Thu, 8 Sep 2016 09:06:01 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:48379 "EHLO s-opensource.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751895AbcIHNF7 (ORCPT ); Thu, 8 Sep 2016 09:05:59 -0400 From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: "H . Nikolaus Schaller" , Javier Martinez Canillas , Mauro Carvalho Chehab , Arnd Bergmann , Guennadi Liakhovetski , Laurent Pinchart , Hans Verkuil , Andrew Morton , linux-media@vger.kernel.org Subject: [PATCH] [media] ov9650: add support for asynchronous probing Date: Thu, 8 Sep 2016 09:05:40 -0400 Message-Id: <1473339940-24572-1-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow the sub-device to be probed asynchronously so a bridge driver that's waiting for the device can be notified and its .bound callback executed. Signed-off-by: Javier Martinez Canillas --- drivers/media/i2c/ov9650.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov9650.c b/drivers/media/i2c/ov9650.c index be5a7fd4f076..502c72238a4a 100644 --- a/drivers/media/i2c/ov9650.c +++ b/drivers/media/i2c/ov9650.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -1520,6 +1521,10 @@ static int ov965x_probe(struct i2c_client *client, /* Update exposure time min/max to match frame format */ ov965x_update_exposure_ctrl(ov965x); + ret = v4l2_async_register_subdev(sd); + if (ret < 0) + goto err_ctrls; + return 0; err_ctrls: v4l2_ctrl_handler_free(sd->ctrl_handler); @@ -1532,7 +1537,7 @@ static int ov965x_remove(struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); - v4l2_device_unregister_subdev(sd); + v4l2_async_unregister_subdev(sd); v4l2_ctrl_handler_free(sd->ctrl_handler); media_entity_cleanup(&sd->entity); -- 2.7.4