title: How can i know the minor on Linux module initialisation
body: <p>I am writing a linux kernel module.</p>
  
  <p>Here is what i've done in module's init function:</p>
  
  <pre><code>register_chrdev(300 /* major */, "mydev", &amp;fops);
  </code></pre>
  
  <p>It works fine. But i need to know the minor number.</p>
  
  <p>I have read we cannot set this minor number. It is the kernel which gives us this number. If so, how can i know it in module's init function ?</p>
  
  <p>Thanks</p>