提交 c34c1819 编写于 作者: A Anshul Garg 提交者: Jonathan Cameron

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: NAnshul Garg <aksgarg1989@gmail.com>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 50672011
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册