Re: v4l2_device_register_subdev_nodes() clean_up code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> One additional thing: I think sd->devnode should also be set as NULL since
> sub-devices are no longer created by the driver owning the media device.

Yes, I think you're right.

But there are also other issues with
v4l2_device_register_subdev_nodes(). I think after checking
V4L2_SUBDEV_FL_HAS_DEVNODE flag yet another check like so:

if (sd->devnode)
    continue;  /* or perhaps raising error, TBD */

would be reasonable. Maybe this is not necessary, I don't know, but
this is cheap and would prevent bad things when a duplicate
/dev/v4l-subdev node is created for the same subdevice and track is
lost of the old one.

Actually, I'm trying to make use of v4l2_async_register_subdev()
protocol and v4l2_device_register_subdev_nodes() doesn't seem to fit
well. Something like v4l2_device_register_subdev_node() (singular)
would be nice. But this is probably an idea that's been already
raised. Anyway in async scenarios I can imagine that nodes
registration is called twice and it should be made somehow taken care
of. Regardles that a single subdev node registration is probably
required for such use cases and it's quite easy to implement.

Anyway, I'll prepare a bug fix patch and maybe another as an
improvement suggestion.
Any comments welcome,
Krzysztof



On Fri, May 30, 2014 at 3:47 PM, Sakari Ailus <sakari.ailus@xxxxxx> wrote:
> On Fri, May 30, 2014 at 03:27:27PM +0200, Krzysztof Czarnowski wrote:
>> Sure, a moment :-)
>
> One additional thing: I think sd->devnode should also be set as NULL since
> sub-devices are no longer created by the driver owning the media device.
>
> This isn't done in the error path or in v4l2_device_unregister_subdev()
> currently.
>
> --
> Sakari Ailus
> e-mail: sakari.ailus@xxxxxx     XMPP: sailus@xxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux