diff options
Diffstat (limited to 'drivers/i2c/i2c-dev.c')
-rw-r--r-- | drivers/i2c/i2c-dev.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index df6e14c192d..5a15e50748d 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -354,9 +354,19 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file, return -EFAULT; } return res; - + case I2C_RETRIES: + client->adapter->retries = arg; + break; + case I2C_TIMEOUT: + client->adapter->timeout = arg; + break; default: - return i2c_control(client,cmd,arg); + /* NOTE: returning a fault code here could cause trouble + * in buggy userspace code. Some old kernel bugs returned + * zero in this case, and userspace code might accidentally + * have depended on that bug. + */ + return -ENOTTY; } return 0; } |