Skip to contentSkip to conversation

iio: potentiometer: tpl0102: remove unneeded i2c check functionality test

PATCH Applied Matt Ranostay 2 participants 3 messages May 12, 2016 – May 15, 2016 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: potentiometer: tpl0102: remove unneeded i2c check functionality test

Actually I2C_FUNC_SMBUS_WORD_DATA isn't need for this device, and regmap handles all single byte reads transparently.

---
 drivers/iio/potentiometer/tpl0102.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/iio/potentiometer/tpl0102.c +0 -4
index 5c304d4..7b6b545 100644
@@ -116,10 +116,6 @@ static int tpl0102_probe(struct i2c_client *client,
 	struct tpl0102_data *data;
 	struct iio_dev *indio_dev;
 
-	if (!i2c_check_functionality(client->adapter,
-				     I2C_FUNC_SMBUS_WORD_DATA))
-		return -EOPNOTSUPP;
-
 	indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
 	if (!indio_dev)
 		return -ENOMEM;
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 4 lines · Matt Ranostay

Actually I2C_FUNC_SMBUS_WORD_DATA isn't need for this device, and regmap handles all single byte reads transparently.

Applied to the togreg branch of iio.git. If you need it quicker I'm happy to push this trivial patch as a fix but only if is preventing known hardware from working (i.e. we have users complaining)

thanks

Jonathan

Quoted 20 lines
---
 drivers/iio/potentiometer/tpl0102.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/iio/potentiometer/tpl0102.c +0 -4
index 5c304d4..7b6b545 100644
@@ -116,10 +116,6 @@ static int tpl0102_probe(struct i2c_client *client,
 	struct tpl0102_data *data;
 	struct iio_dev *indio_dev;
 
-	if (!i2c_check_functionality(client->adapter,
-				     I2C_FUNC_SMBUS_WORD_DATA))
-		return -EOPNOTSUPP;
-
 	indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
 	if (!indio_dev)
 		return -ENOMEM;
#2 lore raw

No isn't breaking any hardware that I know of.

Thanks,

Matt

Quoted 34 lines · Jonathan Cameron
Quoted 4 lines · Matt Ranostay

Actually I2C_FUNC_SMBUS_WORD_DATA isn't need for this device, and regmap handles all single byte reads transparently.

Applied to the togreg branch of iio.git. If you need it quicker I'm happy to push this trivial patch as a fix but only if is preventing known hardware from working (i.e. we have users complaining)

thanks

Jonathan

Quoted 20 lines
---
 drivers/iio/potentiometer/tpl0102.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/iio/potentiometer/tpl0102.c +0 -4
index 5c304d4..7b6b545 100644
@@ -116,10 +116,6 @@ static int tpl0102_probe(struct i2c_client *client,
      struct tpl0102_data *data;
      struct iio_dev *indio_dev;
 
-     if (!i2c_check_functionality(client->adapter,
-                                  I2C_FUNC_SMBUS_WORD_DATA))
-             return -EOPNOTSUPP;
-
      indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
      if (!indio_dev)
              return -ENOMEM;