Re: [PATCH/RFC] videodev.[ch] redesign

Oliver Neukum
2002-02-09T23:32:53Z

On Saturday 09 February 2002 21:44, Gerd Knorr wrote:
> > > It also provides a ioctl wrapper function which handles copying the
> > > ioctl args from/to userspace, so we have this at one place can drop all
> > > the copy_from/to_user calls within the v4l device driver ioctl
> > > handlers.
> >
> > That is a large improvement.
> > But you don't include a lock against reentry, which is bad.
>
> I don't want to handle the wrapper function too much. IMHO it is the
> job of the driver to do locking if needed. For some read-only ioctls
> like VIDIOCGCAP you don't need locking at all.

OK.

> > > Comments?
> >
> > Could you make a helper for open like for ioctl ?
>
> video_open does call video_device[minor]->fops->open(), isn't that
> enought?

I'd prefer seeing exclusive opening handeled in the helper initially.

> > And please don't use a pointer to the device descriptor
> > in the file structure. It makes live for USB devices much harder.
>
> Sorry, I don't understand. What exactly do you mean?
> file->private_data? videodev.c doesn't touch it ...

But the skeleton driver you provide does so.

Regards
Oliver