aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-dev.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-10-13 17:56:32 -0400
committerJean Delvare <khali@hyperion.delvare>2007-10-13 17:56:32 -0400
commit53be79593452e568a856f8393985131848d59b72 (patch)
treeb1abe8a310486a6c0c146cdaf35f93e1f9faada3 /drivers/i2c/i2c-dev.c
parentcdeec3cc79c7b1acfa89fb362b01e544ecfb285c (diff)
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>
Diffstat (limited to 'drivers/i2c/i2c-dev.c')
-rw-r--r--drivers/i2c/i2c-dev.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index df6e14c192d6..5a15e50748de 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,
354 return -EFAULT; 354 return -EFAULT;
355 } 355 }
356 return res; 356 return res;
357 357 case I2C_RETRIES:
358 client->adapter->retries = arg;
359 break;
360 case I2C_TIMEOUT:
361 client->adapter->timeout = arg;
362 break;
358 default: 363 default:
359 return i2c_control(client,cmd,arg); 364 /* NOTE: returning a fault code here could cause trouble
365 * in buggy userspace code. Some old kernel bugs returned
366 * zero in this case, and userspace code might accidentally
367 * have depended on that bug.
368 */
369 return -ENOTTY;
360 } 370 }
361 return 0; 371 return 0;
362} 372}