Few comments I have:device into
- release f_op retval is silently ignored, I guess you will get your
undefined state when the first function fails (esp. when you interruptthe sem)
Hmm.. hadn't realized that. I'm open to suggestions on how to do this
better. The real reason why the synchronization is there is to make
sure that only one client is using the device at a time, using the
is_open flag.
- semaphores are deprecated
- class_device_create is deprecated
What is preferred?
- don't understand this:
memcpy(kbuf, drvdata->read_buffer, bytes_remaining);
drvdata->read_buffer_in_use = bytes_remaining;
free_page((unsigned long)kbuf);
The physical device only generates/accepts complete words, the intention
is to account for the possibility that a read does not read complete
words, and to fulfill the read whenever possible.
It's arguable that read() and write() should not accept or return
partial words, I suppose