title: How program for graceful removal/or no removal if device node is in use
body: <p>I have this device node created using mknod command for a pcie driver.</p>
  
  <pre><code>/dev/pciedrv
  </code></pre>
  
  <p>Upon removing the driver while device node file is open (in use), the system crashes.</p>
  
  <pre><code>rmmod -f pciedrv
  </code></pre>
  
  <p>Is there a way to do a graceful exit? Also how to handle the case when user application accessing the file terminates unexpectedly  before closing the device node. </p>