Find the answer to your Linux question:
Results 1 to 2 of 2
hi guys, For registering a driver into kernel i am using "register_chrdev" with major number & file operations structure(character driver i2c based) Ques: what will happen if i put major ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Location
    india
    Posts
    57

    major number for register_driver


    hi guys,

    For registering a driver into kernel i am using "register_chrdev" with major number & file operations structure(character driver i2c based)

    Ques: what will happen if i put major number=0
    will kernel allocate any major number then, if so how to find what is the major number kernel allocated.

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    The function register_chrdev returns the major number of the registered device so you can print out the number with printk.
    You can also read it from /proc/devices.

    Regards

Posting Permissions

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