/* Close : when somebody close /dev/irnet Destroy the instance of /dev/irnet  */
static int dev_irnet_close(struct inode *inode, struct file *file)
/* Close : when somebody close /dev/irnet Destroy the instance of /dev/irnet  */
static int dev_irnet_close(struct inode *inode, struct file *file)
{
  irnet_socket *	ap = (struct irnet_socket *) file->private_data;
  DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n",
	 file, ap);
  DABORT(ap == NULL, 0, FS_ERROR, "ap is NULL !!!\n");
  file->private_data = NULL;
  irda_irnet_destroy(ap);
  if(ap->ppp_open)
    {
      DERROR(FS_ERROR, "Channel still registered - deregistering !\n");
      ap->ppp_open = 0;
      ppp_unregister_channel(&ap->chan);
    }
  kfree(ap);
  DEXIT(FS_TRACE, "\n");
  return 0;
}