]> Pileus Git - ~andy/linux/commitdiff
iio: light: vcnl4000: Use devm_iio_device_register
authorSachin Kamat <sachin.kamat@linaro.org>
Tue, 29 Oct 2013 11:39:00 +0000 (11:39 +0000)
committerJonathan Cameron <jic23@kernel.org>
Sun, 24 Nov 2013 21:07:18 +0000 (21:07 +0000)
devm_iio_device_register simplifies the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/vcnl4000.c

index ecb3341ef9c07a8e56ddaf1de8d76d31456e6d2a..384ac23f576f3dddcfa276f8070b8b8009b099c6 100644 (file)
@@ -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,
 };