Find the answer to your Linux question:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just 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.

  2. #2
    Just 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,

    Code:
    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
    Just Joined!
    Join Date
    Dec 2010
    Posts
    44
    Thank you very much.

  4. $spacer_open
    $spacer_close

Posting Permissions

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