Skip to contentSkip to conversation

i2c-dev: Fix I2C_SLAVE ioctl comment

PATCH Applied Jean Delvare 2 participants 2 messages Sep 11, 2015 – Oct 23, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c-dev: Fix I2C_SLAVE ioctl comment

The first part of the comment is wrong since November 2007, delete it.

The second part of the comment is related to I2C_PEC, not I2C_SLAVE, so move it where it belongs.

Cc Wolfram Sang <wsa-z923LK4zBo2bacvFa/[email protected]>
---
 drivers/i2c/i2c-dev.c |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
drivers/i2c/i2c-dev.c +7 -10
@@ -421,16 +421,6 @@ static long i2cdev_ioctl(struct file *fi
 	switch (cmd) {
 	case I2C_SLAVE:
 	case I2C_SLAVE_FORCE:
-		/* NOTE:  devices set up to work with "new style" drivers
-		 * can't use I2C_SLAVE, even when the device node is not
-		 * bound to a driver.  Only I2C_SLAVE_FORCE will work.
-		 *
-		 * Setting the PEC flag here won't affect kernel drivers,
-		 * which will be using the i2c_client node registered with
-		 * the driver model core.  Likewise, when that client has
-		 * the PEC flag already set, the i2c-dev driver won't see
-		 * (or use) this setting.
-		 */
 		if ((arg > 0x3ff) ||
 		    (((client->flags & I2C_M_TEN) == 0) && arg > 0x7f))
 			return -EINVAL;
@@ -446,6 +436,13 @@ static long i2cdev_ioctl(struct file *fi
 			client->flags &= ~I2C_M_TEN;
 		return 0;
 	case I2C_PEC:
+		/*
+		 * Setting the PEC flag here won't affect kernel drivers,
+		 * which will be using the i2c_client node registered with
+		 * the driver model core.  Likewise, when that client has
+		 * the PEC flag already set, the i2c-dev driver won't see
+		 * (or use) this setting.
+		 */
 		if (arg)
 			client->flags |= I2C_CLIENT_PEC;
 		else
Signature · 2 lines
Jean Delvare
SUSE L3 Support
Applied
#1 lore raw
Quoted 7 lines · Jean Delvare

The first part of the comment is wrong since November 2007, delete it.

The second part of the comment is related to I2C_PEC, not I2C_SLAVE, so move it where it belongs.

Applied to for-next, thanks!