Reputation: 155
I have written a simple device driver. Only loading the module my device file is getting created. But when my application tries to open the device file I am getting an error -1 (operation not permitted)
. When I have tried to look at device characteristics by executing the command:
$udevadm info -a -p /sys/class/char/<devname>
I get the output:
KERNEL=="<devname>"
SUBSYSTEM=="char"
DRIVER==" "
So apparently my device node is not getting linked to the device driver.
Can anybody please help me out with this.
Thanks
Upvotes: 0
Views: 1217
Reputation: 26322
Have you checked the permissions on the device node udev created?
Udev manages the permissions of those device nodes, and unless you're running as root it's quite likely you're not allowed to read/write from/to the device node.
Edit
If you're running as root the permissions on the device node won't be a factor. Please show us the content of /proc/devices, the output of ls -la /dev/my-device-node
and your code.
Upvotes: 2