Loading arch/cris/arch-v10/drivers/i2c.c +13 −26 Original line number Diff line number Diff line Loading @@ -577,8 +577,7 @@ i2c_release(struct inode *inode, struct file *filp) /* Main device API. ioctl's to write or read to/from i2c registers. */ static int i2c_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg) static long i2c_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) { return -EINVAL; Loading @@ -587,7 +586,7 @@ i2c_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg) switch (_IOC_NR(cmd)) { case I2C_WRITEREG: /* write to an i2c slave */ D(printk("i2cw %d %d %d\n", D(printk(KERN_DEBUG "i2cw %d %d %d\n", I2C_ARGSLAVE(arg), I2C_ARGREG(arg), I2C_ARGVALUE(arg))); Loading @@ -599,32 +598,20 @@ i2c_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg) { unsigned char val; /* read from an i2c slave */ D(printk("i2cr %d %d ", D(printk(KERN_DEBUG "i2cr %d %d ", I2C_ARGSLAVE(arg), I2C_ARGREG(arg))); val = i2c_readreg(I2C_ARGSLAVE(arg), I2C_ARGREG(arg)); D(printk("= %d\n", val)); D(printk(KERN_DEBUG "= %d\n", val)); return val; } default: return -EINVAL; } return 0; } static long i2c_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { long ret; lock_kernel(); ret = i2c_ioctl_unlocked(file, cmd, arg); unlock_kernel(); return ret; } static const struct file_operations i2c_fops = { .owner = THIS_MODULE, .unlocked_ioctl = i2c_ioctl, Loading Loading
arch/cris/arch-v10/drivers/i2c.c +13 −26 Original line number Diff line number Diff line Loading @@ -577,8 +577,7 @@ i2c_release(struct inode *inode, struct file *filp) /* Main device API. ioctl's to write or read to/from i2c registers. */ static int i2c_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg) static long i2c_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { if(_IOC_TYPE(cmd) != ETRAXI2C_IOCTYPE) { return -EINVAL; Loading @@ -587,7 +586,7 @@ i2c_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg) switch (_IOC_NR(cmd)) { case I2C_WRITEREG: /* write to an i2c slave */ D(printk("i2cw %d %d %d\n", D(printk(KERN_DEBUG "i2cw %d %d %d\n", I2C_ARGSLAVE(arg), I2C_ARGREG(arg), I2C_ARGVALUE(arg))); Loading @@ -599,32 +598,20 @@ i2c_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg) { unsigned char val; /* read from an i2c slave */ D(printk("i2cr %d %d ", D(printk(KERN_DEBUG "i2cr %d %d ", I2C_ARGSLAVE(arg), I2C_ARGREG(arg))); val = i2c_readreg(I2C_ARGSLAVE(arg), I2C_ARGREG(arg)); D(printk("= %d\n", val)); D(printk(KERN_DEBUG "= %d\n", val)); return val; } default: return -EINVAL; } return 0; } static long i2c_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { long ret; lock_kernel(); ret = i2c_ioctl_unlocked(file, cmd, arg); unlock_kernel(); return ret; } static const struct file_operations i2c_fops = { .owner = THIS_MODULE, .unlocked_ioctl = i2c_ioctl, Loading