Results 1 to 3 of 3
Hi,
I have written a small character driver, in the cleanup module at the line
int a=unregister_chrdev(Major,DEVICE_NAME);
I am getting the following error
error: void value not ignored as it ...
- 02-08-2011 #1Just Joined!
- Join Date
- Dec 2010
- Posts
- 44
void value not ignored as it ought to be.
Hi,
I have written a small character driver, in the cleanup module at the line
int a=unregister_chrdev(Major,DEVICE_NAME);
I am getting the following error
error: void value not ignored as it ought to be
If the value return by unregister_chrdev() function is not stored in any variable it is working fine...
Please help.
Thank you.
- 02-08-2011 #2Just Joined!
- Join Date
- Feb 2011
- Posts
- 12
unregister_chrdev() returns void, so when you assign it to a variable you get an error; simply do,
Note: Some man pages say unregister_chrdev() returns an integer, but,Code:unregister_chrdev(Major, DEVICE_NAME);
- Obviously it doesn't,
- Kernel functions change often, and are poorly documented, so some man pages are out of date.
- 02-09-2011 #3Just Joined!
- Join Date
- Dec 2010
- Posts
- 44
Thank you very much.


Reply With Quote
