/* Function Description: open device. Mapped to user open(). * Return: Always 0. */ static int envctrl_open(struct inode *inode, struct file *file) { cycle_kernel_lock(); file->private_data = NULL; return 0; }
static int tgt_open(struct inode *inode, struct file *file) { tx_ring.tr_idx = rx_ring.tr_idx = 0; cycle_kernel_lock(); return 0; }
static int d7s_open(struct inode *inode, struct file *f) { if (D7S_MINOR != iminor(inode)) return -ENODEV; cycle_kernel_lock(); atomic_inc(&d7s_users); return 0; }
static int eisa_eeprom_open(struct inode *inode, struct file *file) { cycle_kernel_lock(); if (file->f_mode & FMODE_WRITE) return -EINVAL; return 0; }
static int lcd_open(struct inode *inode, struct file *file) { cycle_kernel_lock(); if (!lcd_present) return -ENXIO; else return 0; }
static int efi_rtc_open(struct inode *inode, struct file *file) { /* * nothing special to do here * We do accept multiple open files at the same time as we * synchronize on the per call operation. */ cycle_kernel_lock(); return 0; }
static int gpio_open(struct inode *inode, struct file *file) { unsigned int pin; cycle_kernel_lock(); pin = iminor(inode); if (pin >= giu_nr_pins) return -EBADF; return nonseekable_open(inode, file); }
static int cs5535_gpio_open(struct inode *inode, struct file *file) { u32 m = iminor(inode); cycle_kernel_lock(); if ((mask & (1 << m)) == 0) return -EINVAL; return nonseekable_open(inode, file); }
static int rng_dev_open (struct inode *inode, struct file *filp) { cycle_kernel_lock(); /* enforce read-only access to this chrdev */ if ((filp->f_mode & FMODE_READ) == 0) return -EINVAL; if ((filp->f_mode & FMODE_WRITE) != 0) return -EINVAL; return 0; }
static int pc8736x_gpio_open(struct inode *inode, struct file *file) { unsigned m = iminor(inode); file->private_data = &pc8736x_gpio_ops; cycle_kernel_lock(); dev_dbg(&pdev->dev, "open %d\n", m); if (m >= PC8736X_GPIO_CT) return -EINVAL; return nonseekable_open(inode, file); }
static int mwave_open(struct inode *inode, struct file *file) { unsigned int retval = 0; PRINTK_3(TRACE_MWAVE, "mwavedd::mwave_open, entry inode %p file %p\n", inode, file); PRINTK_2(TRACE_MWAVE, "mwavedd::mwave_open, exit return retval %x\n", retval); cycle_kernel_lock(); return retval; }
static int ipmi_open(struct inode *ino, struct file *filep) { switch (iminor(ino)) { case WATCHDOG_MINOR: if (test_and_set_bit(0, &ipmi_wdog_open)) return -EBUSY; cycle_kernel_lock(); ipmi_start_timer_on_heartbeat = 1; return nonseekable_open(ino, filep); default: return (-ENODEV); } }
static int i2c_open(struct inode *inode, struct file *filp) { cycle_kernel_lock(); return 0; }
static int anslcd_open( struct inode * inode, struct file * file ) { cycle_kernel_lock(); return 0; }