Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    void value not ignored as it ought to be.


    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.

  2. #2
    unregister_chrdev() returns void, so when you assign it to a variable you get an error; simply do,

    unregister_chrdev(Major, DEVICE_NAME);
    Note: Some man pages say unregister_chrdev() returns an integer, but,
    - Obviously it doesn't,
    - Kernel functions change often, and are poorly documented, so some man pages are out of date.

  3. #3
    Thank you very much.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts