summaryrefslogtreecommitdiffstats
path: root/drivers/iio/industrialio-trigger.c
diff options
context:
space:
mode:
authorkeliu <liuke94@huawei.com>2022-05-27 11:17:39 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-06-11 15:35:29 +0200
commit319dbcd84fd2676afb2bcfee575fbc1fce474ec3 (patch)
tree04be51193fd82e82636c50a53d05ed26d42838bb /drivers/iio/industrialio-trigger.c
parentdt-bindings: iio: accel: Add bmi085 and bmi090l bindings (diff)
downloadlinux-319dbcd84fd2676afb2bcfee575fbc1fce474ec3.tar.xz
linux-319dbcd84fd2676afb2bcfee575fbc1fce474ec3.zip
iio: Directly use ida_alloc()/free()
Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu <liuke94@huawei.com> Link: https://lore.kernel.org/r/20220527091739.2949426-1-liuke94@huawei.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/industrialio-trigger.c')
-rw-r--r--drivers/iio/industrialio-trigger.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index 585b6cef8fcc..1e43e93b5816 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -71,7 +71,7 @@ int __iio_trigger_register(struct iio_trigger *trig_info,
trig_info->owner = this_mod;
- trig_info->id = ida_simple_get(&iio_trigger_ida, 0, 0, GFP_KERNEL);
+ trig_info->id = ida_alloc(&iio_trigger_ida, GFP_KERNEL);
if (trig_info->id < 0)
return trig_info->id;
@@ -98,7 +98,7 @@ error_device_del:
mutex_unlock(&iio_trigger_list_lock);
device_del(&trig_info->dev);
error_unregister_id:
- ida_simple_remove(&iio_trigger_ida, trig_info->id);
+ ida_free(&iio_trigger_ida, trig_info->id);
return ret;
}
EXPORT_SYMBOL(__iio_trigger_register);
@@ -109,7 +109,7 @@ void iio_trigger_unregister(struct iio_trigger *trig_info)
list_del(&trig_info->list);
mutex_unlock(&iio_trigger_list_lock);
- ida_simple_remove(&iio_trigger_ida, trig_info->id);
+ ida_free(&iio_trigger_ida, trig_info->id);
/* Possible issue in here */
device_del(&trig_info->dev);
}