i2c: Remove i2c_algorithm.algo_control()
This removes: - An effectively unused hook: i2c_algorithm.algo_control. - The i2c_control() call, used only by i2c-dev to call that unused hook or set two barely supported adapter params. (That param setting moves into i2c-dev.c ... still iffy due to lack of locking, but no other changes.) As shown by diffstat, this is a net code shrink. It also reduces the complexity of the I2C adapter and /dev interfaces. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
committed by
Jean Delvare
parent
cdeec3cc79
commit
53be795934
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user