> Yes, but Joe's was there first, based on the original driver, that's why
> I accepted his patch.

I understand that. My code is even based partially on it and wouldn't exist
without the reverse engineering/color decoding information that I found at
his site.

> Could you point out the problems in the existing driver?  It sounds like
> some things would be easy to fix, such as control message allocation for
> an example.

The use of the dev_set_drvdata family of calls. I'm not sure why, but those
seem to keep the driver from being inserted, removed, and reinserted.
Replacing those with the use of private_data field in the usb_interface
struct seems to fix that (I removed the usb_put_device call along with
these, so that my be to blame instead).

The control message allocation and async urbs, as previously mentioned.

The is_initialized and needsDummyRead variables are unneeded as the things
"protected" by those variables can/should just be done when the camera is
initialized.

The disconnect handling is wrong for the same reasons mine was. There is no
synchronization with the open/release routines, no making sure that no
communication with the camera is going on, and the cam structure is freed
without checking if users still have the camera open.

framebuf is allocated in both open and mmap calls. Not necessarily wrong...
however, it is possible that if the pointer was overwritten that the memory
would just be reallocated/leaked instead of oopsing, which would indicate a
problem.

There are some other, more subjective things that I take issue with such as
the read function being unnecesarily complicated, the proc interface not
being necessary, raw_image being allocated in open rather than probe, etc.

Some of these things are easy, some are a bit more complicated. My biggest
issue is that the driver that I submitted is a superset of the one that was
merged. I did a lot of work to write/test/debug/etc. that code, and my doing
that again would be a step backwards, in my mind.

John



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to