Follow these steps to test the driver:
Compile "chardev_leds.c" file
You can use the makefile I provide you. In the directory where files are located, type:
make
Insert "chardev_leds.ko" in the Kernel
sudo insmod chardev_leds.ko
Create a new device file managed by the driver
sudo mknod -m 666 /dev/leds c 243 0
We can check if we did these steps well, typing:
cat /dev/leds
This command will print a message
Compile "leds_user.c" file
gcc -Wall -g leds_user.c -o leds_user
Run it
sudo ./leds_user
Remove "chardev_leds.ko" from the Kernel
sudo rmmod chardev_leds
Remove "/dev/leds"
sudo rm -r /dev/leds