iio: convert to common i2c_check_functionality() return value
authorMatt Ranostay <mranostay@gmail.com>
Sat, 27 Feb 2016 06:13:49 +0000 (22:13 -0800)
committerJonathan Cameron <jic23@kernel.org>
Sat, 27 Feb 2016 17:17:43 +0000 (17:17 +0000)
Previously most drivers that used a i2c_check_functionality() check
condition required various error codes on failure. This patchset
converts to a standard of -EOPNOTSUPP

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
20 files changed:
drivers/iio/adc/mcp3422.c
drivers/iio/adc/ti-adc081c.c
drivers/iio/chemical/vz89x.c
drivers/iio/humidity/hdc100x.c
drivers/iio/humidity/htu21.c
drivers/iio/humidity/si7005.c
drivers/iio/humidity/si7020.c
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
drivers/iio/light/bh1750.c
drivers/iio/light/jsa1212.c
drivers/iio/potentiometer/mcp4531.c
drivers/iio/pressure/mpl115_i2c.c
drivers/iio/pressure/ms5611_i2c.c
drivers/iio/pressure/ms5637.c
drivers/iio/pressure/t5403.c
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
drivers/iio/temperature/mlx90614.c
drivers/iio/temperature/tmp006.c
drivers/iio/temperature/tsys01.c
drivers/iio/temperature/tsys02d.c

index ebad83e3fbf7a4d35978dfd2c75bcb628154f51b..d7b36efd2f3ced994b49da023e0f582c472f2230 100644 (file)
@@ -339,7 +339,7 @@ static int mcp3422_probe(struct i2c_client *client,
        u8 config;
 
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*adc));
        if (!indio_dev)
index 2c8374f8625201ea0578a1669490e3be65230abf..ecbc12138d589d5379ab51b744942b64822115d8 100644 (file)
@@ -73,7 +73,7 @@ static int adc081c_probe(struct i2c_client *client,
        int err;
 
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        iio = devm_iio_device_alloc(&client->dev, sizeof(*adc));
        if (!iio)
index b8b8049232301cc8d335cb2788c71f4fb1765e30..652649da500faff381f330749cc8262ce6ce65ca 100644 (file)
@@ -249,7 +249,7 @@ static int vz89x_probe(struct i2c_client *client,
                                I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BYTE))
                data->xfer = vz89x_smbus_xfer;
        else
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
 
        i2c_set_clientdata(client, indio_dev);
        data->client = client;
index a7f61e881a4901ed7d21b636f4bb0889716a7d62..fa47676131733744859f25b1bfa0f2183ac8f61d 100644 (file)
@@ -274,7 +274,7 @@ static int hdc100x_probe(struct i2c_client *client,
 
        if (!i2c_check_functionality(client->adapter,
                                I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BYTE))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
        if (!indio_dev)
index d1636a74980ec7acf06c5456a8a2bc07851b59a2..11cbc38b450f77179c7713a795a93fcf58f9ac43 100644 (file)
@@ -192,7 +192,7 @@ static int htu21_probe(struct i2c_client *client,
                                     I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
                dev_err(&client->dev,
                        "Adapter does not support some i2c transaction\n");
-               return -ENODEV;
+               return -EOPNOTSUPP;
        }
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*dev_data));
index 98a022fa26ad0c81999881326f879a1009c03f53..6297766e93d06cb8ead937cf5ba10d30b940b407 100644 (file)
@@ -135,7 +135,7 @@ static int si7005_probe(struct i2c_client *client,
        int ret;
 
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
        if (!indio_dev)
index 5ab4e06fb5449c9a9af97c2c0994c7906db63a03..ffc2ccf6374e644ac27a25296ef16371221a487e 100644 (file)
@@ -121,7 +121,7 @@ static int si7020_probe(struct i2c_client *client,
        if (!i2c_check_functionality(client->adapter,
                                     I2C_FUNC_SMBUS_WRITE_BYTE |
                                     I2C_FUNC_SMBUS_READ_WORD_DATA))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        /* Reset device, loads default settings. */
        ret = i2c_smbus_write_byte(client, SI7020CMD_RESET);
index e6247c3508afac615c2a3f6517d24d5309a00f18..f581256d9d4c2473eca8979b3c0075c308f844a8 100644 (file)
@@ -121,7 +121,7 @@ static int inv_mpu_probe(struct i2c_client *client,
 
        if (!i2c_check_functionality(client->adapter,
                                     I2C_FUNC_SMBUS_I2C_BLOCK))
-               return -ENOSYS;
+               return -EOPNOTSUPP;
 
        regmap = devm_regmap_init_i2c(client, &inv_mpu_regmap_config);
        if (IS_ERR(regmap)) {
index 8b4164343f2001c2128f7d5e7c5ce33090adeb50..b05946604f804ca333c988762ab5dc54ae217f40 100644 (file)
@@ -241,7 +241,7 @@ static int bh1750_probe(struct i2c_client *client,
 
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C |
                                I2C_FUNC_SMBUS_WRITE_BYTE))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
        if (!indio_dev)
index c4e8c6b6c3c31ccbf0124b551694b48def01c269..99a62816c3b439559b5145c70dacf96585cb8c76 100644 (file)
@@ -326,7 +326,7 @@ static int jsa1212_probe(struct i2c_client *client,
        int ret;
 
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
        if (!indio_dev)
index a3f66874ee2e43058c36e05125c7370ff95e7161..0db67fe1476695a2b95af4f61036b98f25310b19 100644 (file)
@@ -159,7 +159,7 @@ static int mcp4531_probe(struct i2c_client *client,
        if (!i2c_check_functionality(client->adapter,
                                     I2C_FUNC_SMBUS_WORD_DATA)) {
                dev_err(dev, "SMBUS Word Data not supported\n");
-               return -EIO;
+               return -EOPNOTSUPP;
        }
 
        indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
index 9ea055c3f89e09a07f8018e82e17073e2b2b1d5b..1a29be462f6e15c2c01819d6503ee9f7c9da3113 100644 (file)
@@ -42,7 +42,7 @@ static int mpl115_i2c_probe(struct i2c_client *client,
                         const struct i2c_device_id *id)
 {
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        return mpl115_probe(&client->dev, id->name, &mpl115_i2c_ops);
 }
index ae6753941fab5b95ab44e93d5357088872947b74..7f6fc8eee922b7ff7b3ae71d8a71945a086fe3cb 100644 (file)
@@ -92,7 +92,7 @@ static int ms5611_i2c_probe(struct i2c_client *client,
                                     I2C_FUNC_SMBUS_WRITE_BYTE |
                                     I2C_FUNC_SMBUS_READ_WORD_DATA |
                                     I2C_FUNC_SMBUS_READ_I2C_BLOCK))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*st));
        if (!indio_dev)
index e8d0e0da938d10d048c2a534e8a6cb67fd1fd8c8..e68052c118e60163b023c7e55e0d86dd39793fd8 100644 (file)
@@ -136,7 +136,7 @@ static int ms5637_probe(struct i2c_client *client,
                                     I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
                dev_err(&client->dev,
                        "Adapter does not support some i2c transaction\n");
-               return -ENODEV;
+               return -EOPNOTSUPP;
        }
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*dev_data));
index e11cd3938d673ac77be07c7467375a438ec6f003..2667e71721f5100f0c7bdf7659bd3e32ce80a409 100644 (file)
@@ -221,7 +221,7 @@ static int t5403_probe(struct i2c_client *client,
 
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA |
            I2C_FUNC_SMBUS_I2C_BLOCK))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        ret = i2c_smbus_read_byte_data(client, T5403_SLAVE_ADDR);
        if (ret < 0)
index db35e04a063767a9b2b6011cf3d0345c9d0929bd..4f502386aa8629ffcc935fd09a1d360c1905413c 100644 (file)
@@ -278,7 +278,7 @@ static int lidar_probe(struct i2c_client *client,
                                I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BYTE))
                data->xfer = lidar_smbus_xfer;
        else
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
 
        indio_dev->info = &lidar_info;
        indio_dev->name = LIDAR_DRV_NAME;
index a570c2e2aac3e42998eabdba95c619f8615d7ce6..4b645fc672aad8b85d02ebaede8e244bb17c8d32 100644 (file)
@@ -516,7 +516,7 @@ static int mlx90614_probe(struct i2c_client *client,
        int ret;
 
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
        if (!indio_dev)
index e78c1069a6a9f66bcd3f0969a94678a956279152..18c9b43c02cb60583a15b29423ef09e449a0121e 100644 (file)
@@ -205,7 +205,7 @@ static int tmp006_probe(struct i2c_client *client,
        int ret;
 
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
-               return -ENODEV;
+               return -EOPNOTSUPP;
 
        if (!tmp006_check_identification(client)) {
                dev_err(&client->dev, "no TMP006 sensor\n");
index 05c12060ce8ddac0439d9f714d38c9b0ed7730ba..3e60c6189d98b8d30d1f4d4c32186eeae1e62276 100644 (file)
@@ -190,7 +190,7 @@ static int tsys01_i2c_probe(struct i2c_client *client,
                                     I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
                dev_err(&client->dev,
                        "Adapter does not support some i2c transaction\n");
-               return -ENODEV;
+               return -EOPNOTSUPP;
        }
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*dev_data));
index 4c1fbd52ea08e103c06e962fcb3e0e2c2ed0496b..ab6fe8f6f2d15da7aab32f379dc00623b6d87fcc 100644 (file)
@@ -137,7 +137,7 @@ static int tsys02d_probe(struct i2c_client *client,
                                     I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
                dev_err(&client->dev,
                        "Adapter does not support some i2c transaction\n");
-               return -ENODEV;
+               return -EOPNOTSUPP;
        }
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*dev_data));