These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / iio / cdc / ad7152.c
index 87110d9..485d0a5 100644 (file)
@@ -290,7 +290,7 @@ static int ad7152_write_raw(struct iio_dev *indio_dev,
                ret = 0;
                break;
        case IIO_CHAN_INFO_SCALE:
-               if (val != 0) {
+               if (val) {
                        ret = -EINVAL;
                        goto out;
                }
@@ -502,7 +502,7 @@ static int ad7152_probe(struct i2c_client *client,
        indio_dev->num_channels = ARRAY_SIZE(ad7152_channels);
        indio_dev->modes = INDIO_DIRECT_MODE;
 
-       ret = iio_device_register(indio_dev);
+       ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev);
        if (ret)
                return ret;
 
@@ -511,15 +511,6 @@ static int ad7152_probe(struct i2c_client *client,
        return 0;
 }
 
-static int ad7152_remove(struct i2c_client *client)
-{
-       struct iio_dev *indio_dev = i2c_get_clientdata(client);
-
-       iio_device_unregister(indio_dev);
-
-       return 0;
-}
-
 static const struct i2c_device_id ad7152_id[] = {
        { "ad7152", 0 },
        { "ad7153", 1 },
@@ -533,7 +524,6 @@ static struct i2c_driver ad7152_driver = {
                .name = KBUILD_MODNAME,
        },
        .probe = ad7152_probe,
-       .remove = ad7152_remove,
        .id_table = ad7152_id,
 };
 module_i2c_driver(ad7152_driver);