[cpia] patch for cpia_pp.c - free_dma was missing and some comments on the '10 10'

Bastian sTYLe@WtAl.De
Mon, 06 Mar 2000 15:55:35 +0100


At 23:08 5.3.2000 +0100, Peter Pregler wrote:
>Hi,
>
>As for the segfault I got in the '10 10'-case I think I have found the reason.
>Can anyone comment about the following change of return values. The 
>function in
>question is cpia_register_camera. Someone changed the return values ENXIO
>(maybe EIO would have been better) to success??? Here is 0.5.0
>
>         /* get version information from camera: open/reset/close */
>
>         /* open cpia */
>         if (camera[i]->ops->open(camera[i]->index, 
> &camera[i]->lowlevel_data))
>{                return -ENXIO;
>         }
>
>         /* reset the camera */
>         if(reset_camera(camera[i]) != 0) {
>                 camera[i]->ops->close(camera[i]->lowlevel_data);
>                 return -ENXIO;
>         }
>
>         /* close cpia */
>         camera[i]->ops->close(camera[i]->lowlevel_data);
>
>And here is the latest 0.7.3:
>
>         /* get version information from camera: open/reset/close */
>
>         /* open cpia */
>         if (camera->ops->open(camera->lowlevel_data))
>                 return camera;
>
>         /* reset the camera */
>         if (reset_camera(camera) != 0) {
>                 camera->ops->close(camera->lowlevel_data);
>                 return camera;
>         }
>
>         /* close cpia */
>         camera->ops->close(camera->lowlevel_data);
>

if have changed the two return-parts. now i get a segfault during
loading the cpia_pp module.
btw, it was me (maybe others) who got the 10-10-... problem

>If the open/reset of the camera fails there is not much reason to report
>success. Actually I am pretty sure that is a road to hell, i.e. segmentation
>faults and the like. IMHO the register of the device must fail if the
>open/reset fails.

maby some additional information about my cam :

MFG:VLSI Vision Ltd;MDL:DUAL Camera;CMD:CPIA_1-00;CLS:MEDIA;DES:Parallel 
Port Camera;


>-Peter
>
>-------------------------------
>Even the thought that a ship was waiting to take him back to Earth
>did not wipe out the sense of loss he felt at that moment.
>-------------------------------
>Email: Peter.Pregler@risc.uni-linz.ac.at
>Peter Pregler / RISC, University of Linz, Austria

Bastian