summaryrefslogtreecommitdiff
path: root/drivers/iio/inkern.c
diff options
context:
space:
mode:
authorAnshul Garg <aksgarg1989@gmail.com>2015-12-08 20:45:56 +0300
committerJonathan Cameron <jic23@kernel.org>2015-12-12 20:23:37 +0300
commitc34c18195d30aa3b95f5ae1b4349875c45fdb8e4 (patch)
tree381c6971291d01b918e1c127dc27d11a105e7af1 /drivers/iio/inkern.c
parent50672011d676aea5e521bc77dfce0c9eea040782 (diff)
downloadlinux-c34c18195d30aa3b95f5ae1b4349875c45fdb8e4.tar.xz
iio/inkern.c Use list_for_each_entry_safe
Use list_for_each_entry_safe instead of list_for_each_safe and list_entry call. Signed-off-by: Anshul Garg <aksgarg1989@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/inkern.c')
-rw-r--r--drivers/iio/inkern.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index c8bad3cf891d..80fbbfd76faf 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -61,12 +61,10 @@ EXPORT_SYMBOL_GPL(iio_map_array_register);
int iio_map_array_unregister(struct iio_dev *indio_dev)
{
int ret = -ENODEV;
- struct iio_map_internal *mapi;
- struct list_head *pos, *tmp;
+ struct iio_map_internal *mapi, *next;
mutex_lock(&iio_map_list_lock);
- list_for_each_safe(pos, tmp, &iio_map_list) {
- mapi = list_entry(pos, struct iio_map_internal, l);
+ list_for_each_entry_safe(mapi, next, &iio_map_list, l) {
if (indio_dev == mapi->indio_dev) {
list_del(&mapi->l);
kfree(mapi);