diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-10-29 15:39:00 +0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-11-25 01:07:18 +0400 |
commit | 691dab4291f5df64e08d49529e3eafc481811555 (patch) | |
tree | f4181592fe7abd66d6b1cbfd6fa3863b383ea6df /drivers/iio/light | |
parent | 9bcbf02ae38abd45fecf618d6f648927bd12d34d (diff) | |
download | linux-691dab4291f5df64e08d49529e3eafc481811555.tar.xz |
iio: light: vcnl4000: Use devm_iio_device_register
devm_iio_device_register simplifies the code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/light')
-rw-r--r-- | drivers/iio/light/vcnl4000.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index ecb3341ef9c0..384ac23f576f 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -179,13 +179,7 @@ static int vcnl4000_probe(struct i2c_client *client, indio_dev->name = VCNL4000_DRV_NAME; indio_dev->modes = INDIO_DIRECT_MODE; - return iio_device_register(indio_dev); -} - -static int vcnl4000_remove(struct i2c_client *client) -{ - iio_device_unregister(i2c_get_clientdata(client)); - return 0; + return devm_iio_device_register(&client->dev, indio_dev); } static struct i2c_driver vcnl4000_driver = { @@ -194,7 +188,6 @@ static struct i2c_driver vcnl4000_driver = { .owner = THIS_MODULE, }, .probe = vcnl4000_probe, - .remove = vcnl4000_remove, .id_table = vcnl4000_id, }; |