Re: zr36120 2.6.x port (was: Re: [Mjpeg-users] DC30+ can't capturesize greater than 224x168)

From: Ronald Bultje
Date: Thu Sep 25 2003 - 14:21:33 EST


Hi,

On Thu, 2003-09-25 at 18:10, Christoph Hellwig wrote:
> On Thu, Sep 25, 2003 at 05:59:44PM +0200, Ronald Bultje wrote:
> > + if (!try_module_get(THIS_MODULE)) {
> > + printk(KERN_ERR "failed to acquire lock on myself\n");
> > + return -EIO;
> > + }
>
> This is broken, you need an owner outside the open routine.

Eh? could you explain, please?

> > +
> > + /* find the device */
> > + for (i = 0; i < zoran_cards; i++) {
> > + if (zorans[i].video_dev->minor == minor) {
> > + ztv = &zorans[i];
> > + break;
> > + }
> > + }
>
> What serializes this?

We have an array of devices, and in order to find the right one, we go
through the array until the inode belonging to the device that's being
opened matches the one in the video device that we reigstered during
module loading. I don't know of a way to get that information in any
direct (non-loop) way, but that might be because I never cared to. I
admit it's ugly, but it's correct and used in other drivers, too.

Ronald

--
Ronald Bultje <rbultje@xxxxxxxxxxxxxxxxxxx>
Linux Video/Multimedia developer

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/