From: Ioana Ciornei Date: Fri, 2 Oct 2015 10:37:49 +0000 (+0300) Subject: staging: iio: light: use devm_iio_device_register instead iio_device_register X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=86727e30d1d6485b5f8b4a84790ac659dc002d27;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: iio: light: use devm_iio_device_register instead iio_device_register Replace iio_device_register with resource managed devm_iio_device_register in order to ease the error path. Also delete the remove function since there is no need after this change. Signed-off-by: Ioana Ciornei Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c index cd6f2727aa58..32ae1127da33 100644 --- a/drivers/staging/iio/light/isl29028.c +++ b/drivers/staging/iio/light/isl29028.c @@ -513,7 +513,7 @@ static int isl29028_probe(struct i2c_client *client, indio_dev->name = id->name; indio_dev->dev.parent = &client->dev; 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 < 0) { dev_err(chip->dev, "iio registration fails with error %d\n", ret); @@ -522,14 +522,6 @@ static int isl29028_probe(struct i2c_client *client, return 0; } -static int isl29028_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 isl29028_id[] = { {"isl29028", 0}, {} @@ -550,7 +542,6 @@ static struct i2c_driver isl29028_driver = { .of_match_table = isl29028_of_match, }, .probe = isl29028_probe, - .remove = isl29028_remove, .id_table = isl29028_id, }; diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index b5e1b8b0a6f0..df602038a4bd 100644 --- a/drivers/staging/iio/light/tsl2583.c +++ b/drivers/staging/iio/light/tsl2583.c @@ -862,7 +862,7 @@ static int taos_probe(struct i2c_client *clientp, indio_dev->dev.parent = &clientp->dev; indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->name = chip->client->name; - ret = iio_device_register(indio_dev); + ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev); if (ret) { dev_err(&clientp->dev, "iio registration failed\n"); return ret; @@ -917,13 +917,6 @@ static SIMPLE_DEV_PM_OPS(taos_pm_ops, taos_suspend, taos_resume); #define TAOS_PM_OPS NULL #endif -static int taos_remove(struct i2c_client *client) -{ - iio_device_unregister(i2c_get_clientdata(client)); - - return 0; -} - static struct i2c_device_id taos_idtable[] = { { "tsl2580", 0 }, { "tsl2581", 1 }, @@ -940,7 +933,6 @@ static struct i2c_driver taos_driver = { }, .id_table = taos_idtable, .probe = taos_probe, - .remove = taos_remove, }; module_i2c_driver(taos_driver);