I found a good code as example for a character device module : https://github.com/euspectre/kedr/blob/master/sources/examples/sample_target/cfake.c
I do not modified the code and I tested it. I obtained two devices (/dev/cfake0 and /dev/cfake1) but I would like to understand something.
There is two devices exported, but only one read function, how to specify which read function use for each device (if two read functions are implemented)?
In the end I would like to have two character devices (one for I2C communication, another one for SPI) on the same module, the module and user-space need the communication so I need to export both of them.