v4l2-event: v4l2_event_queue: do nothing if vdev == NULL
PATCH 1/1 v4l2-event: v4l2_event_queue: do nothing if vdev == NULL
If the vdev pointer == NULL, then just return.
This makes it easier for subdev drivers to use this function without having to check if the sd->devnode pointer is NULL or not.
drivers/media/v4l2-core/v4l2-event.c +3 -0
@@ -172,6 +172,9 @@ void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev)unsigned long flags;struct timespec timestamp; +if (vdev ==NULL ) +return ; +ktime_get_ts (×tamp);spin_lock_irqsave (&vdev->fh_lock, flags);
Hi Hans,
Quoted 4 lines · Hans Verkuil
If the vdev pointer == NULL, then just return.
This makes it easier for subdev drivers to use this function without having to check if the
sd->devnodepointer is NULL or not.
Do you have an example of when this would be useful? Isn't it a rather fundamental question to a driver whether or not it exposes a device node, i.e. why would a driver use v4l2_event_queue() in the first place if it does not expose a device node, and so the event interface?
Quoted 17 lines
Signed-off-by Hans Verkuil <[email protected]>drivers/media/v4l2-core/v4l2-event.c +3
-0@@ -172,6 +172,9 @@ void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev)unsigned long flags;struct timespec timestamp; +if (vdev ==NULL ) +return ; +ktime_get_ts (×tamp);spin_lock_irqsave (&vdev->fh_lock, flags);
Signature · 4 lines
Regards, Sakari Ailus e-mail: [email protected] XMPP: [email protected]
Quoted 5 lines · Sakari Ailus
Hi Hans,
Quoted 2 lines · Hans Verkuil
If the vdev pointer == NULL, then just return.
Quoted 7 lines
Quoted 2 lines
This makes it easier for subdev drivers to use this function without having to check if the
sd->devnodepointer is NULL or not.Do you have an example of when this would be useful? Isn't it a rather fundamental question to a driver whether or not it exposes a device node, i.e. why would a driver use
v4l2_event_queue()in the first place if it does not expose a device node, and so the event interface?
The device node will only be created if the subdev driver supports it and if the bridge driver requests it. So if the subdev driver supports it, but the bridge driver does not request it there will be no devnode. The patch is to handle that case.
This patch is a requirement for this series which adds support for direct event notification to some subdev drivers. Why this is necessary and useful can be found in the series patch description. http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/92808
- Lars
Sakari Ailus
Acked-byHi Lars-Peter,
Quoted 19 lines · Lars-Peter Clausen
Quoted 5 lines · Sakari Ailus
Hi Hans,
Quoted 2 lines · Hans Verkuil
If the vdev pointer == NULL, then just return.
Quoted 7 lines
Quoted 2 lines
This makes it easier for subdev drivers to use this function without having to check if the
sd->devnodepointer is NULL or not.Do you have an example of when this would be useful? Isn't it a rather fundamental question to a driver whether or not it exposes a device node, i.e. why would a driver use
v4l2_event_queue()in the first place if it does not expose a device node, and so the event interface?The device node will only be created if the subdev driver supports it and if the bridge driver requests it. So if the subdev driver supports it, but the bridge driver does not request it there will be no devnode. The patch is to handle that case.
Quoted 4 lines
This patch is a requirement for this series which adds support for direct event notification to some subdev drivers. Why this is necessary and useful can be found in the series patch description.
http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/92808
Ok, fair enough.
Signature · 4 lines
Regards, Sakari Ailus e-mail: [email protected] XMPP: [email protected]