From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932297AbbIULXi (ORCPT ); Mon, 21 Sep 2015 07:23:38 -0400 Received: from lists.s-osg.org ([54.187.51.154]:38287 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932165AbbIULXh (ORCPT ); Mon, 21 Sep 2015 07:23:37 -0400 From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Laurent Pinchart , Sakari Ailus , Javier Martinez Canillas , Mauro Carvalho Chehab , Boris BREZILLON , Krzysztof Kozlowski , Prabhakar Lad , Guennadi Liakhovetski , Hans Verkuil , linux-media@vger.kernel.org Subject: [PATCH] [media] tvp5150: add support for asynchronous probing Date: Mon, 21 Sep 2015 13:23:09 +0200 Message-Id: <1442834589-1194-1-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.4.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow the subdevice to be probed asynchronously. Signed-off-by: Javier Martinez Canillas --- drivers/media/i2c/tvp5150.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index 522a865c5c60..3c5fb2509c47 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -1172,8 +1173,7 @@ static int tvp5150_probe(struct i2c_client *c, sd->ctrl_handler = &core->hdl; if (core->hdl.error) { res = core->hdl.error; - v4l2_ctrl_handler_free(&core->hdl); - return res; + goto err; } v4l2_ctrl_handler_setup(&core->hdl); @@ -1186,9 +1186,17 @@ static int tvp5150_probe(struct i2c_client *c, core->rect.left = 0; core->rect.width = TVP5150_H_MAX; + res = v4l2_async_register_subdev(sd); + if (res < 0) + goto err; + if (debug > 1) tvp5150_log_status(sd); return 0; + +err: + v4l2_ctrl_handler_free(&core->hdl); + return res; } static int tvp5150_remove(struct i2c_client *c) @@ -1200,7 +1208,7 @@ static int tvp5150_remove(struct i2c_client *c) "tvp5150.c: removing tvp5150 adapter on address 0x%x\n", c->addr << 1); - v4l2_device_unregister_subdev(sd); + v4l2_async_unregister_subdev(sd); v4l2_ctrl_handler_free(&decoder->hdl); return 0; } -- 2.4.3