public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 2/8] [media] v4l2-async: call registered_async after subdev registration
Date: Thu, 11 Aug 2016 14:18:18 +0300	[thread overview]
Message-ID: <20160811111817.GS3182@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <20160811111042.GQ3182@valkosipuli.retiisi.org.uk>

On Thu, Aug 11, 2016 at 02:10:43PM +0300, Sakari Ailus wrote:
> Hi Javier,
> 
> On Fri, Feb 05, 2016 at 04:09:52PM -0300, Javier Martinez Canillas wrote:
> > V4L2 sub-devices might need to do initialization that depends on being
> > registered with a V4L2 device. As an example, sub-devices with Media
> > Controller support may need to register entities and create pad links.
> > 
> > Execute the registered_async callback after the sub-device has been
> > registered with the V4L2 device so the driver can do any needed init.
> > 
> > Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> > ---
> > 
> >  drivers/media/v4l2-core/v4l2-async.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
> > index 5bada202b2d3..716bfd47daab 100644
> > --- a/drivers/media/v4l2-core/v4l2-async.c
> > +++ b/drivers/media/v4l2-core/v4l2-async.c
> > @@ -119,6 +119,13 @@ static int v4l2_async_test_notify(struct v4l2_async_notifier *notifier,
> >  		return ret;
> >  	}
> >  
> > +	ret = v4l2_subdev_call(sd, core, registered_async);
> > +	if (ret < 0) {
> > +		if (notifier->unbind)
> > +			notifier->unbind(notifier, sd, asd);
> > +		return ret;
> > +	}
> > +
> >  	if (list_empty(&notifier->waiting) && notifier->complete)
> >  		return notifier->complete(notifier);
> 
> I noticed this just now but what do you need this and the next patch for?
> 
> We already have a callback for the same purpose: it's
> v4l2_subdev_ops.internal_ops.registered(). And there's similar
> unregistered() callback as well.
> 
> Could you use these callbacks instead?
> 
> What made me notice this is because the two patches break all other drivers
> that do not implement registered_async(). This would be fixed by your
> follow-up patch which is not merged, but the real question is: are these
> patches needed to begin with?

Ah, it's actually merged now. So all is well. The question still remains.
:-)

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

  reply	other threads:[~2016-08-11 11:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 19:09 [PATCH 0/8] [media] tvp5150: add HW input connectors support Javier Martinez Canillas
2016-02-05 19:09 ` [PATCH 1/8] [media] v4l2-subdev: add registered_async subdev core operation Javier Martinez Canillas
2016-02-05 19:09 ` [PATCH 2/8] [media] v4l2-async: call registered_async after subdev registration Javier Martinez Canillas
2016-08-11 11:10   ` Sakari Ailus
2016-08-11 11:18     ` Sakari Ailus [this message]
2016-08-11 16:14       ` Javier Martinez Canillas
2016-08-11 19:28         ` Sakari Ailus
2016-02-05 19:09 ` [PATCH 3/8] [media] tvp5150: put endpoint node on error Javier Martinez Canillas
2016-02-05 19:09 ` [PATCH 4/8] [media] tvp5150: store dev id and rom version Javier Martinez Canillas
2016-02-05 19:09 ` [PATCH 5/8] [media] tvp5150: add internal signal generator to HW input list Javier Martinez Canillas
2016-02-05 19:09 ` [PATCH 6/8] [media] tvp5150: move input definition header to dt-bindings Javier Martinez Canillas
2016-02-05 19:09 ` [PATCH 7/8] [media] tvp5150: document input connectors DT bindings Javier Martinez Canillas
2016-02-08 18:23   ` Javier Martinez Canillas
2016-02-05 19:09 ` [PATCH 8/8] [media] tvp5150: add HW input connectors support Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160811111817.GS3182@valkosipuli.retiisi.org.uk \
    --to=sakari.ailus@iki.fi \
    --cc=hans.verkuil@cisco.com \
    --cc=javier@osg.samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox