title: How to deal with cdev_init and proc_create at the same time?
body: <p>I know that in linux kernel 5.6 or higher I should use <em>proc_ops</em> to replace file operations, but now I need to use <code>cdev_init()</code> and <code>proc_create()</code> for the same structure, how should I do?</p>
  <pre><code>#if LINUX_VERSION_CODE &lt;= KERNEL_VERSION(5, 6, 0)
  static struct file_operations ilitek_fops = {
  #if LINUX_VERSION_CODE &gt;= KERNEL_VERSION(2, 6, 36)
      .unlocked_ioctl = ilitek_file_ioctl,
  #else
      .ioctl = ilitek_file_ioctl,
  #endif
      .read = ilitek_file_read,
      .write = ilitek_file_write,
      .open = ilitek_file_open,
      .release = ilitek_file_close,
  };
  #else
  static struct proc_ops ilitek_fops = {
  #if LINUX_VERSION_CODE &gt;= KERNEL_VERSION(2, 6, 36)
      .proc_ioctl = ilitek_file_ioctl,
  #else
      .ioctl = ilitek_file_ioctl,
  #endif
      .proc_read = ilitek_file_read,
      .proc_write = ilitek_file_write,
      .proc_open = ilitek_file_open,
      .proc_release = ilitek_file_close,
  };
  #endif
  
  cdev_init(&amp;ilitek_dev.cdev, &amp;ilitek_fops);
  ...
  proc_create(&quot;ilitek_ctrl&quot;, ILITEK_DEVICE_NODE_PERMISSON, NULL, &amp;ilitek_fops);
  </code></pre>
  <p>As shown above, I cannot pass the structure to both functions at the same time.</p>