diff options
author | Beomho Seo <beomho.seo@samsung.com> | 2014-06-18 07:21:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-06-21 12:40:37 +0100 |
commit | b97855354aaacd65d68805bce38af4af1ef703f9 (patch) | |
tree | 3c4b03595f9bab11ef003a84ae4277639b531a14 | |
parent | 1b791fadf3a1749505b6cf04d4ef58d278ee42cd (diff) | |
download | linux-b97855354aaacd65d68805bce38af4af1ef703f9.tar.gz linux-b97855354aaacd65d68805bce38af4af1ef703f9.tar.bz2 linux-b97855354aaacd65d68805bce38af4af1ef703f9.zip |
iio: light: cm32181: Use devm_* APIs
This patch changes API from iio_device_register() to devm_* API.
Using API make code simpler.
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/light/cm32181.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/iio/light/cm32181.c b/drivers/iio/light/cm32181.c index d976e6ce60db..ad36b294e4d5 100644 --- a/drivers/iio/light/cm32181.c +++ b/drivers/iio/light/cm32181.c @@ -331,7 +331,7 @@ static int cm32181_probe(struct i2c_client *client, return ret; } - ret = iio_device_register(indio_dev); + ret = devm_iio_device_register(&client->dev, indio_dev); if (ret) { dev_err(&client->dev, "%s: regist device failed\n", @@ -342,14 +342,6 @@ static int cm32181_probe(struct i2c_client *client, return 0; } -static int cm32181_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 cm32181_id[] = { { "cm32181", 0 }, { } @@ -370,7 +362,6 @@ static struct i2c_driver cm32181_driver = { }, .id_table = cm32181_id, .probe = cm32181_probe, - .remove = cm32181_remove, }; module_i2c_driver(cm32181_driver); |