Re: V4l Api: video_register() fails. <-- Consider this please..

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



Hi Luca,

On Fri, 2002-12-13 at 08:38, Luca wrote:
> The following code fails when i try to register the v4l device and a 
> 'Segmentation fault' message occurs.  I tested my code using both linux 
> 2.4.19 and linux 2.4.20. The video_device structure seems to be filled 
> properly, i don't know what is wrong...

Use ksymoops to debug the oops. That might give you a valid backtrace,
you could also use kgdb to 'really' debug it, though I'm not really used
to kgdb yet.

>        camera->v4l.priv = (void*)camera;

I don't think you're supposed to use the priv field here. Using fops
should give you a 'struct file *file' on open(), use file->private_data
for these purposes. On open(), just search the global array of
registered devices for which device was being opened. That way, you
don't need to use the priv field.

HTH,

Ronald

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





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux