I use the sample ioctl code (ioctl.c, chardev.c) given in
from Linux Kernel Programming Guide.
I used the same sample program given there.
I loaded the chardev.o module and before that i created a node for the devide file using mknod char_dev c 100 0.
After that i get the device registered properly in chardev.c.
But while trying to set some message using the ioctl_set_msg function in ioctlc.c i get this error
ioctl_set_msg failed:-1.

I am not sure where i am goign wrong.

can anyone tell me what's wrong? Is there anything extra i need to do??