interface for a hardware trigger driver

Philipp Ittershagen p.ittershagen at googlemail.com
Thu May 10 10:16:36 EDT 2012


Hi Andre,

On Thu, May 10, 2012 at 03:18:49PM +0200, Andre Haupt wrote:
> Or better, reading the device file blocks and returns the trigger status (none,
> triggered, aborted) and writing to the device file wakes up the sleeping
> processes.
> 
> So cat /dev/mydevice would block until an interrupt occurs or someone does
> an echo foo > /dev/mydevice.

this is even better, yes.

> 
> I vagely remember having done that in the first place. I cant remember
> why i went with the ioctl stuff back then, though.

It's always good to drop ioctl code ;) Using the semantics you mentionend
above for read() and write(), the code gets simpler and easier to follow IMHO.


Greetings,

  Philipp



More information about the Kernelnewbies mailing list