mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
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 <ciorneiioana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
252fb58ceb
commit
86727e30d1
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user