From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755333AbcBPTyL (ORCPT ); Tue, 16 Feb 2016 14:54:11 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:51157 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751104AbcBPTyJ (ORCPT ); Tue, 16 Feb 2016 14:54:09 -0500 Date: Tue, 16 Feb 2016 13:53:51 -0600 From: Benoit Parrot To: Javier Martinez Canillas CC: , Sakari Ailus , Mauro Carvalho Chehab , Bryan Wu , Laurent Pinchart , Subject: Re: [PATCH] [media] v4l2-async: Don't fail if registered_async isn't implemented Message-ID: <20160216195351.GG1380@ti.com> References: <1455648666-4377-1-git-send-email-javier@osg.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1455648666-4377-1-git-send-email-javier@osg.samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Javier Martinez Canillas wrote on Tue [2016-Feb-16 15:51:05 -0300]: > After sub-dev registration in v4l2_async_test_notify(), the v4l2-async > core calls the registered_async callback but if a sub-dev driver does > not implement it, v4l2_subdev_call() will return a -ENOIOCTLCMD which > should not be considered an error. > > Reported-by: Benoit Parrot > Signed-off-by: Javier Martinez Canillas > > --- > > drivers/media/v4l2-core/v4l2-async.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c > index 716bfd47daab..4d809115ba49 100644 > --- a/drivers/media/v4l2-core/v4l2-async.c > +++ b/drivers/media/v4l2-core/v4l2-async.c > @@ -113,7 +113,7 @@ static int v4l2_async_test_notify(struct v4l2_async_notifier *notifier, > list_move(&sd->async_list, ¬ifier->done); > > ret = v4l2_device_register_subdev(notifier->v4l2_dev, sd); > - if (ret < 0) { > + if (ret < 0 && ret != -ENOIOCTLCMD) { NAK. This fix should be on the next if block. The one that actually invokes the registered_async call back. As is it does not help. Benoit > if (notifier->unbind) > notifier->unbind(notifier, sd, asd); > return ret; > -- > 2.5.0 >