devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> --- drivers/staging/iio/cdc/ad7152.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/iio/cdc/ad7152.c b/drivers/staging/iio/cdc/ad7152.c index f2c309d..f925ecb 100644 --- a/drivers/staging/iio/cdc/ad7152.c +++ b/drivers/staging/iio/cdc/ad7152.c @@ -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(&client->dev, 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); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html