Logo Search packages:      
Sourcecode: linux version File versions  Download package

int drm_stub_open ( struct inode *  inode,
struct file *  filp 

File open operation.

inode device inode.
filp file pointer.
Puts the dev->fops corresponding to the device minor number into filp, call the open method, and restore the file operations.

Definition at line 168 of file drm_fops.c.

      struct drm_device *dev = NULL;
      int minor = iminor(inode);
      int err = -ENODEV;
      const struct file_operations *old_fops;


      if (!((minor >= 0) && (minor < drm_cards_limit)))
            return -ENODEV;

      if (!drm_heads[minor])
            return -ENODEV;

      if (!(dev = drm_heads[minor]->dev))
            return -ENODEV;

      old_fops = filp->f_op;
      filp->f_op = fops_get(&dev->driver->fops);
      if (filp->f_op->open && (err = filp->f_op->open(inode, filp))) {
            filp->f_op = fops_get(old_fops);

      return err;

Generated by  Doxygen 1.6.0   Back to index