Web lists-archives.com

Re: [Spca50x-devs] Fwd: webcam recognized by driver but freeze the apps




Le Jeudi 26 Avril 2007 21:47, Thomas Kaiser a écrit :
> emmanuel simonnet wrote:
> >> Hello Emmanuel
> >>
> >> Replace the code in spca50x_create_sysfs() with this one:
> >> static int
> >> spca50x_create_sysfs(struct video_device *vdev)
> >> {
> >>        video_device_create_file(vdev, &class_device_attr_stream_id);
> >>        video_device_create_file(vdev, &class_device_attr_model);
> >>        video_device_create_file(vdev, &class_device_attr_pictsetting);
> >>
> >>      return 0;
> >> }
> >>
> >> and it should be possible to compile.
> >
> > Thanks for the hint but static int is already in the code.
> >
> > Part of gspca_core.c :
> >
> > static CLASS_DEVICE_ATTR(pictsetting, S_IRUGO, show_pictsetting, NULL);
> > static int
> > spca50x_create_sysfs(struct video_device *vdev)
> > {
> > 	int rc;
> >
> > 	rc = video_device_create_file(vdev, &class_device_attr_stream_id);
> > 	if (rc) goto err_stream_id;
> > 	rc = video_device_create_file(vdev, &class_device_attr_model);
> > 	if (rc) goto err_model;
> > 	rc = video_device_create_file(vdev, &class_device_attr_pictsetting);
> > 	if (rc) goto err_pictsetting;
> >
> > 	return 0;
> >
> > err_pictsetting:
> > 	video_device_remove_file(vdev, &class_device_attr_model);
> > err_model:
> > 	video_device_remove_file(vdev, &class_device_attr_stream_id);
> > err_stream_id:
> > 	return rc;
> >
> > Should be sthg else.
> >
> >> Should be good enough to see if your cam is working, now.
> >
> > Yes,i definitely want to see my cam working.
> >
> >> Have fun :-)
> >>
> >> Thomas
>
> OK, your new code should look like this (the old (new) function
> commented out):
>
> ........
> static CLASS_DEVICE_ATTR(pictsetting, S_IRUGO, show_pictsetting, NULL);
> /*
> static int
> spca50x_create_sysfs(struct video_device *vdev)
> {
> 	int rc;
> 	rc = 0;
>
> 	rc = video_device_create_file(vdev, &class_device_attr_stream_id);
> 	if (rc) goto err_stream_id;
> 	rc = video_device_create_file(vdev, &class_device_attr_model);
> 	if (rc) goto err_model;
> 	rc = video_device_create_file(vdev, &class_device_attr_pictsetting);
> 	if (rc) goto err_pictsetting;
>
> 	return 0;
>
> err_pictsetting:
> 	video_device_remove_file(vdev, &class_device_attr_model);
> err_model:
> 	video_device_remove_file(vdev, &class_device_attr_stream_id);
> err_stream_id:
> 	return rc;
> }
> */
> static int
> spca50x_create_sysfs(struct video_device *vdev)
> {
>    	video_device_create_file(vdev, &class_device_attr_stream_id);
>    	video_device_create_file(vdev, &class_device_attr_model);
>    	video_device_create_file(vdev, &class_device_attr_pictsetting);
>
> 	return 0;
> }
>
> /**************************************************************************
>** *
> *  USB routines
> *
> ***************************************************************************
>/ static int
> gspca_attach_bridge(struct usb_spca50x *spca50x)
> {
> ........
> Hope this will clarify?
>
> Thomas
I will investigate tomorrow but it compile and run fine for me :(
-- 
Michel Xhaard
http://mxhaard.free.fr

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Spca50x-devs mailing list
Spca50x-devs@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/spca50x-devs